{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "27f8e692",
   "metadata": {},
   "source": [
    "## 该文件解决问题2和问题3\n",
    "### 问题2\n",
    "从需求关键词视角，分析在不同标注Tag或者Category类别中， 编程开发人员的组合需求（Mashup）与该需求所调用的服务（Web API）的关联情况。\n",
    "### 问题3\n",
    "从非功能视角（例如API之间的兼容性，Web API不同的服务接口协议REST、RPC），对功能类别相等的若干 Web API进行分析（ Web API Tag 标注值 或者 Web API 所属 Category 类别相等）。在Tag 取值相等 或者 Category取值相等的Web API集合内，统计API被使用的情况，尝试从非功能视角进行原因分析（例如API之间的兼容性，Web API不同的服务接口协议REST、RPC） 注：API之间的兼容性是指 历史上共同被调用的情况。如果有过共同调用的记录，说明这两个API兼容"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "21b5be96",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "dt1 = pd.read_csv(\"m-a_edges.csv\",encoding=\"utf8\")\n",
    "dt2 = pd.read_csv(\"api_nodes_estimator.csv\",index_col = 1,encoding=\"utf8\")\n",
    "dt3 = pd.read_csv(\"mashup_nodes_estimator1.csv\",index_col = 2,encoding=\"utf8\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "22f4e788",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>source</th>\n",
       "      <th>target</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Mashup: CouponRoots</td>\n",
       "      <td>/api/coupon</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Mashup: Raise the Money</td>\n",
       "      <td>/api/nationbuilder</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Mashup: AnythingToHTML</td>\n",
       "      <td>/api/hpe-haven-ondemand-view-document</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Mashup: Velocipedia</td>\n",
       "      <td>/api/mapbox</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Mashup: Api Expert - MyMemory Language Translator</td>\n",
       "      <td>/api/mymemory</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12609</th>\n",
       "      <td>Mashup: Libraries411</td>\n",
       "      <td>/api/geocoder</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12610</th>\n",
       "      <td>Mashup: Libraries411</td>\n",
       "      <td>/api/geocoderca</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12611</th>\n",
       "      <td>Mashup: National Geographic Map Machine</td>\n",
       "      <td>/api/globexplorer</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12612</th>\n",
       "      <td>Mashup: Splashr</td>\n",
       "      <td>/api/flickr</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12613</th>\n",
       "      <td>Mashup: Smarkets</td>\n",
       "      <td>/api/amazon-product-advertising</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>12614 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  source  \\\n",
       "0                                    Mashup: CouponRoots   \n",
       "1                                Mashup: Raise the Money   \n",
       "2                                 Mashup: AnythingToHTML   \n",
       "3                                    Mashup: Velocipedia   \n",
       "4      Mashup: Api Expert - MyMemory Language Translator   \n",
       "...                                                  ...   \n",
       "12609                               Mashup: Libraries411   \n",
       "12610                               Mashup: Libraries411   \n",
       "12611            Mashup: National Geographic Map Machine   \n",
       "12612                                    Mashup: Splashr   \n",
       "12613                                   Mashup: Smarkets   \n",
       "\n",
       "                                      target  \n",
       "0                                /api/coupon  \n",
       "1                         /api/nationbuilder  \n",
       "2      /api/hpe-haven-ondemand-view-document  \n",
       "3                                /api/mapbox  \n",
       "4                              /api/mymemory  \n",
       "...                                      ...  \n",
       "12609                          /api/geocoder  \n",
       "12610                        /api/geocoderca  \n",
       "12611                      /api/globexplorer  \n",
       "12612                            /api/flickr  \n",
       "12613        /api/amazon-product-advertising  \n",
       "\n",
       "[12614 rows x 2 columns]"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt1=dt1.drop(columns=['Unnamed: 2','Unnamed: 3'])\n",
    "dt1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "68cf7804",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>tp</th>\n",
       "      <th>name</th>\n",
       "      <th>st</th>\n",
       "      <th>et</th>\n",
       "      <th>oet</th>\n",
       "      <th>c</th>\n",
       "      <th>oac</th>\n",
       "      <th>ac</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>url</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>/api/pinnaclecart-rest</th>\n",
       "      <td>api</td>\n",
       "      <td>PinnacleCart REST API MASTER RECORD</td>\n",
       "      <td>2011/1/25</td>\n",
       "      <td>2014/11/4</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/volusion-shopping-cart</th>\n",
       "      <td>api</td>\n",
       "      <td>Volusion Shopping Cart API MASTER RECORD</td>\n",
       "      <td>2012/6/14</td>\n",
       "      <td>2014/9/14</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/untappd</th>\n",
       "      <td>api</td>\n",
       "      <td>Untappd API MASTER RECORD</td>\n",
       "      <td>2010/12/21</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>Food</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/envato</th>\n",
       "      <td>api</td>\n",
       "      <td>Envato API MASTER RECORD</td>\n",
       "      <td>2011/3/2</td>\n",
       "      <td>2019/6/5</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/edrv-ev-charging</th>\n",
       "      <td>api</td>\n",
       "      <td>eDRV EV Charging API MASTER RECORD</td>\n",
       "      <td>2020/7/29</td>\n",
       "      <td>2020/7/31</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>Energy</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/dropbox-sync</th>\n",
       "      <td>api</td>\n",
       "      <td>Dropbox Sync API MASTER RECORD</td>\n",
       "      <td>2014/9/21</td>\n",
       "      <td>2017/1/17</td>\n",
       "      <td>2015/10/7</td>\n",
       "      <td>Syncing</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/kratia</th>\n",
       "      <td>api</td>\n",
       "      <td>Kratia API MASTER RECORD</td>\n",
       "      <td>2006/2/3</td>\n",
       "      <td>2012/8/23</td>\n",
       "      <td>2014/4/19</td>\n",
       "      <td>Search</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/messagemost</th>\n",
       "      <td>api</td>\n",
       "      <td>MessageMost API MASTER RECORD</td>\n",
       "      <td>2009/12/23</td>\n",
       "      <td>2016/9/30</td>\n",
       "      <td>2014/4/19</td>\n",
       "      <td>Social</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/sec-watch</th>\n",
       "      <td>api</td>\n",
       "      <td>SEC Watch API MASTER RECORD</td>\n",
       "      <td>2009/1/27</td>\n",
       "      <td>2014/2/10</td>\n",
       "      <td>2014/4/19</td>\n",
       "      <td>Financial</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/answerbag</th>\n",
       "      <td>api</td>\n",
       "      <td>Answerbag API MASTER RECORD</td>\n",
       "      <td>2007/2/15</td>\n",
       "      <td>2013/5/26</td>\n",
       "      <td>2014/4/19</td>\n",
       "      <td>Q&amp;A</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>23579 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                              tp                                      name  \\\n",
       "url                                                                          \n",
       "/api/pinnaclecart-rest       api       PinnacleCart REST API MASTER RECORD   \n",
       "/api/volusion-shopping-cart  api  Volusion Shopping Cart API MASTER RECORD   \n",
       "/api/untappd                 api                 Untappd API MASTER RECORD   \n",
       "/api/envato                  api                  Envato API MASTER RECORD   \n",
       "/api/edrv-ev-charging        api        eDRV EV Charging API MASTER RECORD   \n",
       "...                          ...                                       ...   \n",
       "/api/dropbox-sync            api            Dropbox Sync API MASTER RECORD   \n",
       "/api/kratia                  api                  Kratia API MASTER RECORD   \n",
       "/api/messagemost             api             MessageMost API MASTER RECORD   \n",
       "/api/sec-watch               api               SEC Watch API MASTER RECORD   \n",
       "/api/answerbag               api               Answerbag API MASTER RECORD   \n",
       "\n",
       "                                     st         et        oet          c  \\\n",
       "url                                                                        \n",
       "/api/pinnaclecart-rest        2011/1/25  2014/11/4  2222/2/22  eCommerce   \n",
       "/api/volusion-shopping-cart   2012/6/14  2014/9/14  2222/2/22  eCommerce   \n",
       "/api/untappd                 2010/12/21  2222/2/22  2222/2/22       Food   \n",
       "/api/envato                    2011/3/2   2019/6/5  2222/2/22  eCommerce   \n",
       "/api/edrv-ev-charging         2020/7/29  2020/7/31  2222/2/22     Energy   \n",
       "...                                 ...        ...        ...        ...   \n",
       "/api/dropbox-sync             2014/9/21  2017/1/17  2015/10/7    Syncing   \n",
       "/api/kratia                    2006/2/3  2012/8/23  2014/4/19     Search   \n",
       "/api/messagemost             2009/12/23  2016/9/30  2014/4/19     Social   \n",
       "/api/sec-watch                2009/1/27  2014/2/10  2014/4/19  Financial   \n",
       "/api/answerbag                2007/2/15  2013/5/26  2014/4/19        Q&A   \n",
       "\n",
       "                               oac     ac  \n",
       "url                                        \n",
       "/api/pinnaclecart-rest        True  False  \n",
       "/api/volusion-shopping-cart   True  False  \n",
       "/api/untappd                  True   True  \n",
       "/api/envato                   True  False  \n",
       "/api/edrv-ev-charging         True  False  \n",
       "...                            ...    ...  \n",
       "/api/dropbox-sync            False  False  \n",
       "/api/kratia                  False  False  \n",
       "/api/messagemost             False  False  \n",
       "/api/sec-watch               False  False  \n",
       "/api/answerbag               False  False  \n",
       "\n",
       "[23579 rows x 8 columns]"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "28432760",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>tp</th>\n",
       "      <th>url</th>\n",
       "      <th>st</th>\n",
       "      <th>et</th>\n",
       "      <th>oet</th>\n",
       "      <th>c</th>\n",
       "      <th>oac</th>\n",
       "      <th>ac</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Mashup: CouponRoots</th>\n",
       "      <td>mashup</td>\n",
       "      <td>http://www.couponroots.com</td>\n",
       "      <td>2015/8/4</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>Coupons</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: Raise the Money</th>\n",
       "      <td>mashup</td>\n",
       "      <td>https://raisethemoney.com/</td>\n",
       "      <td>2014/10/12</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>Funding</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: AnythingToHTML</th>\n",
       "      <td>mashup</td>\n",
       "      <td>https://paraggupta1993.github.io/AnythingToHTML/</td>\n",
       "      <td>2015/5/12</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>Documents</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: Velocipedia</th>\n",
       "      <td>mashup</td>\n",
       "      <td>http://velocipedia.eu</td>\n",
       "      <td>2014/11/4</td>\n",
       "      <td>2019/7/23</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: Moves Daily Life</th>\n",
       "      <td>mashup</td>\n",
       "      <td>https://github.com/hyeshik/moves-daily-life</td>\n",
       "      <td>2015/4/28</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>2222/2/22</td>\n",
       "      <td>Fitness</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: Veedemus Video</th>\n",
       "      <td>mashup</td>\n",
       "      <td>Undefined</td>\n",
       "      <td>2009/3/5</td>\n",
       "      <td>2016/7/13</td>\n",
       "      <td>2014/5/1</td>\n",
       "      <td>Video</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: SafeResolver</th>\n",
       "      <td>mashup</td>\n",
       "      <td>Undefined</td>\n",
       "      <td>2009/11/12</td>\n",
       "      <td>2015/11/24</td>\n",
       "      <td>2014/5/1</td>\n",
       "      <td>Domains</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: Flickr Leech</th>\n",
       "      <td>mashup</td>\n",
       "      <td>Undefined</td>\n",
       "      <td>2006/3/13</td>\n",
       "      <td>2008/10/21</td>\n",
       "      <td>2014/4/30</td>\n",
       "      <td>Search</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: Tagbulb</th>\n",
       "      <td>mashup</td>\n",
       "      <td>Undefined</td>\n",
       "      <td>2006/12/2</td>\n",
       "      <td>2015/1/31</td>\n",
       "      <td>2014/4/21</td>\n",
       "      <td>Bookmarks</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: Seattle Movie Finder</th>\n",
       "      <td>mashup</td>\n",
       "      <td>Undefined</td>\n",
       "      <td>2005/10/9</td>\n",
       "      <td>2008/5/9</td>\n",
       "      <td>2014/4/30</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>7766 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                  tp  \\\n",
       "name                                   \n",
       "Mashup: CouponRoots           mashup   \n",
       "Mashup: Raise the Money       mashup   \n",
       "Mashup: AnythingToHTML        mashup   \n",
       "Mashup: Velocipedia           mashup   \n",
       "Mashup: Moves Daily Life      mashup   \n",
       "...                              ...   \n",
       "Mashup: Veedemus Video        mashup   \n",
       "Mashup: SafeResolver          mashup   \n",
       "Mashup: Flickr Leech          mashup   \n",
       "Mashup: Tagbulb               mashup   \n",
       "Mashup: Seattle Movie Finder  mashup   \n",
       "\n",
       "                                                                           url  \\\n",
       "name                                                                             \n",
       "Mashup: CouponRoots                                 http://www.couponroots.com   \n",
       "Mashup: Raise the Money                             https://raisethemoney.com/   \n",
       "Mashup: AnythingToHTML        https://paraggupta1993.github.io/AnythingToHTML/   \n",
       "Mashup: Velocipedia                                      http://velocipedia.eu   \n",
       "Mashup: Moves Daily Life           https://github.com/hyeshik/moves-daily-life   \n",
       "...                                                                        ...   \n",
       "Mashup: Veedemus Video                                               Undefined   \n",
       "Mashup: SafeResolver                                                 Undefined   \n",
       "Mashup: Flickr Leech                                                 Undefined   \n",
       "Mashup: Tagbulb                                                      Undefined   \n",
       "Mashup: Seattle Movie Finder                                         Undefined   \n",
       "\n",
       "                                      st          et        oet          c  \\\n",
       "name                                                                         \n",
       "Mashup: CouponRoots             2015/8/4   2222/2/22  2222/2/22    Coupons   \n",
       "Mashup: Raise the Money       2014/10/12   2222/2/22  2222/2/22    Funding   \n",
       "Mashup: AnythingToHTML         2015/5/12   2222/2/22  2222/2/22  Documents   \n",
       "Mashup: Velocipedia            2014/11/4   2019/7/23  2222/2/22    Mapping   \n",
       "Mashup: Moves Daily Life       2015/4/28   2222/2/22  2222/2/22    Fitness   \n",
       "...                                  ...         ...        ...        ...   \n",
       "Mashup: Veedemus Video          2009/3/5   2016/7/13   2014/5/1      Video   \n",
       "Mashup: SafeResolver          2009/11/12  2015/11/24   2014/5/1    Domains   \n",
       "Mashup: Flickr Leech           2006/3/13  2008/10/21  2014/4/30     Search   \n",
       "Mashup: Tagbulb                2006/12/2   2015/1/31  2014/4/21  Bookmarks   \n",
       "Mashup: Seattle Movie Finder   2005/10/9    2008/5/9  2014/4/30    Mapping   \n",
       "\n",
       "                                oac     ac  \n",
       "name                                        \n",
       "Mashup: CouponRoots            True   True  \n",
       "Mashup: Raise the Money        True   True  \n",
       "Mashup: AnythingToHTML         True   True  \n",
       "Mashup: Velocipedia            True  False  \n",
       "Mashup: Moves Daily Life       True   True  \n",
       "...                             ...    ...  \n",
       "Mashup: Veedemus Video        False  False  \n",
       "Mashup: SafeResolver          False  False  \n",
       "Mashup: Flickr Leech          False  False  \n",
       "Mashup: Tagbulb               False  False  \n",
       "Mashup: Seattle Movie Finder  False  False  \n",
       "\n",
       "[7766 rows x 8 columns]"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "883fedd5",
   "metadata": {},
   "outputs": [],
   "source": [
    "api_c=[]\n",
    "for url in dt1['target']:\n",
    "    if url in dt2.index.values:\n",
    "        api_c.append(dt2.loc[url]['c'])\n",
    "    else:\n",
    "        api_c.append('NaN')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "71213a34",
   "metadata": {},
   "outputs": [],
   "source": [
    "mushap_c=[]\n",
    "for mashup in dt1['source']:\n",
    "    #print(mashup)\n",
    "    #print(dt3.loc[mashup]['c'])\n",
    "    if mashup in dt3.index.values:\n",
    "        mushap_c.append(dt3.loc[mashup]['c'])\n",
    "    else:\n",
    "        mushap_c.append('NaN')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "4ea99be8",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>source</th>\n",
       "      <th>target</th>\n",
       "      <th>mushap_c</th>\n",
       "      <th>api_c</th>\n",
       "      <th>num</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Mashup: CouponRoots</td>\n",
       "      <td>/api/coupon</td>\n",
       "      <td>Coupons</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Mashup: Raise the Money</td>\n",
       "      <td>/api/nationbuilder</td>\n",
       "      <td>Funding</td>\n",
       "      <td>Social</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Mashup: AnythingToHTML</td>\n",
       "      <td>/api/hpe-haven-ondemand-view-document</td>\n",
       "      <td>Documents</td>\n",
       "      <td>Documents</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Mashup: Velocipedia</td>\n",
       "      <td>/api/mapbox</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Mashup: Api Expert - MyMemory Language Translator</td>\n",
       "      <td>/api/mymemory</td>\n",
       "      <td>Translation</td>\n",
       "      <td>Tools</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12609</th>\n",
       "      <td>Mashup: Libraries411</td>\n",
       "      <td>/api/geocoder</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12610</th>\n",
       "      <td>Mashup: Libraries411</td>\n",
       "      <td>/api/geocoderca</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12611</th>\n",
       "      <td>Mashup: National Geographic Map Machine</td>\n",
       "      <td>/api/globexplorer</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12612</th>\n",
       "      <td>Mashup: Splashr</td>\n",
       "      <td>/api/flickr</td>\n",
       "      <td>Photos</td>\n",
       "      <td>Photos</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12613</th>\n",
       "      <td>Mashup: Smarkets</td>\n",
       "      <td>/api/amazon-product-advertising</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>12614 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  source  \\\n",
       "0                                    Mashup: CouponRoots   \n",
       "1                                Mashup: Raise the Money   \n",
       "2                                 Mashup: AnythingToHTML   \n",
       "3                                    Mashup: Velocipedia   \n",
       "4      Mashup: Api Expert - MyMemory Language Translator   \n",
       "...                                                  ...   \n",
       "12609                               Mashup: Libraries411   \n",
       "12610                               Mashup: Libraries411   \n",
       "12611            Mashup: National Geographic Map Machine   \n",
       "12612                                    Mashup: Splashr   \n",
       "12613                                   Mashup: Smarkets   \n",
       "\n",
       "                                      target     mushap_c      api_c  num  \n",
       "0                                /api/coupon      Coupons        NaN    0  \n",
       "1                         /api/nationbuilder      Funding     Social    0  \n",
       "2      /api/hpe-haven-ondemand-view-document    Documents  Documents    0  \n",
       "3                                /api/mapbox      Mapping    Mapping    0  \n",
       "4                              /api/mymemory  Translation      Tools    0  \n",
       "...                                      ...          ...        ...  ...  \n",
       "12609                          /api/geocoder      Mapping    Mapping    0  \n",
       "12610                        /api/geocoderca      Mapping    Mapping    0  \n",
       "12611                      /api/globexplorer      Mapping    Mapping    0  \n",
       "12612                            /api/flickr       Photos     Photos    0  \n",
       "12613        /api/amazon-product-advertising    eCommerce  eCommerce    0  \n",
       "\n",
       "[12614 rows x 5 columns]"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt1['mushap_c'] = mushap_c\n",
    "dt1['api_c'] = api_c\n",
    "dt1['num'] = 0\n",
    "dt1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "9f227fb5",
   "metadata": {},
   "outputs": [],
   "source": [
    "dt1.loc[(dt1.loc[:,'mushap_c'] == dt1.loc[:,'api_c']),'num'] = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "b2a9a375",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>source</th>\n",
       "      <th>target</th>\n",
       "      <th>mushap_c</th>\n",
       "      <th>api_c</th>\n",
       "      <th>num</th>\n",
       "      <th>num2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Mashup: CouponRoots</td>\n",
       "      <td>/api/coupon</td>\n",
       "      <td>Coupons</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Mashup: Raise the Money</td>\n",
       "      <td>/api/nationbuilder</td>\n",
       "      <td>Funding</td>\n",
       "      <td>Social</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Mashup: AnythingToHTML</td>\n",
       "      <td>/api/hpe-haven-ondemand-view-document</td>\n",
       "      <td>Documents</td>\n",
       "      <td>Documents</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Mashup: Velocipedia</td>\n",
       "      <td>/api/mapbox</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Mashup: Api Expert - MyMemory Language Translator</td>\n",
       "      <td>/api/mymemory</td>\n",
       "      <td>Translation</td>\n",
       "      <td>Tools</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12609</th>\n",
       "      <td>Mashup: Libraries411</td>\n",
       "      <td>/api/geocoder</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12610</th>\n",
       "      <td>Mashup: Libraries411</td>\n",
       "      <td>/api/geocoderca</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12611</th>\n",
       "      <td>Mashup: National Geographic Map Machine</td>\n",
       "      <td>/api/globexplorer</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12612</th>\n",
       "      <td>Mashup: Splashr</td>\n",
       "      <td>/api/flickr</td>\n",
       "      <td>Photos</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12613</th>\n",
       "      <td>Mashup: Smarkets</td>\n",
       "      <td>/api/amazon-product-advertising</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>12614 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  source  \\\n",
       "0                                    Mashup: CouponRoots   \n",
       "1                                Mashup: Raise the Money   \n",
       "2                                 Mashup: AnythingToHTML   \n",
       "3                                    Mashup: Velocipedia   \n",
       "4      Mashup: Api Expert - MyMemory Language Translator   \n",
       "...                                                  ...   \n",
       "12609                               Mashup: Libraries411   \n",
       "12610                               Mashup: Libraries411   \n",
       "12611            Mashup: National Geographic Map Machine   \n",
       "12612                                    Mashup: Splashr   \n",
       "12613                                   Mashup: Smarkets   \n",
       "\n",
       "                                      target     mushap_c      api_c  num  \\\n",
       "0                                /api/coupon      Coupons        NaN    0   \n",
       "1                         /api/nationbuilder      Funding     Social    0   \n",
       "2      /api/hpe-haven-ondemand-view-document    Documents  Documents    1   \n",
       "3                                /api/mapbox      Mapping    Mapping    1   \n",
       "4                              /api/mymemory  Translation      Tools    0   \n",
       "...                                      ...          ...        ...  ...   \n",
       "12609                          /api/geocoder      Mapping    Mapping    1   \n",
       "12610                        /api/geocoderca      Mapping    Mapping    1   \n",
       "12611                      /api/globexplorer      Mapping    Mapping    1   \n",
       "12612                            /api/flickr       Photos     Photos    1   \n",
       "12613        /api/amazon-product-advertising    eCommerce  eCommerce    1   \n",
       "\n",
       "       num2  \n",
       "0         1  \n",
       "1         1  \n",
       "2         1  \n",
       "3         1  \n",
       "4         1  \n",
       "...     ...  \n",
       "12609     1  \n",
       "12610     1  \n",
       "12611     1  \n",
       "12612     1  \n",
       "12613     1  \n",
       "\n",
       "[12614 rows x 6 columns]"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt1['num2']=1\n",
    "dt1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "id": "b55c5e3a",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>source</th>\n",
       "      <th>target</th>\n",
       "      <th>mushap_c</th>\n",
       "      <th>api_c</th>\n",
       "      <th>num</th>\n",
       "      <th>num2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Mashup: CouponRoots</td>\n",
       "      <td>/api/coupon</td>\n",
       "      <td>Coupons</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Mashup: Raise the Money</td>\n",
       "      <td>/api/nationbuilder</td>\n",
       "      <td>Funding</td>\n",
       "      <td>Social</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Mashup: Api Expert - MyMemory Language Translator</td>\n",
       "      <td>/api/mymemory</td>\n",
       "      <td>Translation</td>\n",
       "      <td>Tools</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Mashup: Adtegrity</td>\n",
       "      <td>/api/nationbuilder</td>\n",
       "      <td>Advertising</td>\n",
       "      <td>Social</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Mashup: Particle Reviews</td>\n",
       "      <td>/api/rotten-tomatoes</td>\n",
       "      <td>Movies</td>\n",
       "      <td>Recommendations</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12592</th>\n",
       "      <td>Mashup: Adactio Elsewhere</td>\n",
       "      <td>/api/upcomingorg</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>Events</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12594</th>\n",
       "      <td>Mashup: Adactio Elsewhere</td>\n",
       "      <td>/api/delicious-0</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>Bookmarks</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12595</th>\n",
       "      <td>Mashup: Auction Mapper for eBay</td>\n",
       "      <td>/api/ebay</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Search</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12605</th>\n",
       "      <td>Mashup: San Francisco Parking Availability</td>\n",
       "      <td>/api/google-maps</td>\n",
       "      <td>Transportation</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12606</th>\n",
       "      <td>Mashup: Silicon Valley VC Funding</td>\n",
       "      <td>/api/google-maps</td>\n",
       "      <td>Financial</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>9276 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  source  \\\n",
       "0                                    Mashup: CouponRoots   \n",
       "1                                Mashup: Raise the Money   \n",
       "4      Mashup: Api Expert - MyMemory Language Translator   \n",
       "5                                      Mashup: Adtegrity   \n",
       "6                               Mashup: Particle Reviews   \n",
       "...                                                  ...   \n",
       "12592                          Mashup: Adactio Elsewhere   \n",
       "12594                          Mashup: Adactio Elsewhere   \n",
       "12595                    Mashup: Auction Mapper for eBay   \n",
       "12605         Mashup: San Francisco Parking Availability   \n",
       "12606                  Mashup: Silicon Valley VC Funding   \n",
       "\n",
       "                     target        mushap_c            api_c  num  num2  \n",
       "0               /api/coupon         Coupons              NaN    0     1  \n",
       "1        /api/nationbuilder         Funding           Social    0     1  \n",
       "4             /api/mymemory     Translation            Tools    0     1  \n",
       "5        /api/nationbuilder     Advertising           Social    0     1  \n",
       "6      /api/rotten-tomatoes          Movies  Recommendations    0     1  \n",
       "...                     ...             ...              ...  ...   ...  \n",
       "12592      /api/upcomingorg       eCommerce           Events    0     1  \n",
       "12594      /api/delicious-0       eCommerce        Bookmarks    0     1  \n",
       "12595             /api/ebay         Mapping           Search    0     1  \n",
       "12605      /api/google-maps  Transportation          Mapping    0     1  \n",
       "12606      /api/google-maps       Financial          Mapping    0     1  \n",
       "\n",
       "[9276 rows x 6 columns]"
      ]
     },
     "execution_count": 117,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 对于\n",
    "#dtt = dt1[dt1['num'] != dt1['num2']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "69232465",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>num</th>\n",
       "      <th>num2</th>\n",
       "      <th>percent</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mushap_c</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Mapping</th>\n",
       "      <td>1064</td>\n",
       "      <td>1692</td>\n",
       "      <td>0.628842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Social</th>\n",
       "      <td>304</td>\n",
       "      <td>771</td>\n",
       "      <td>0.394293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>eCommerce</th>\n",
       "      <td>289</td>\n",
       "      <td>630</td>\n",
       "      <td>0.458730</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Music</th>\n",
       "      <td>259</td>\n",
       "      <td>653</td>\n",
       "      <td>0.396631</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Photos</th>\n",
       "      <td>251</td>\n",
       "      <td>549</td>\n",
       "      <td>0.457195</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Location</th>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Loyalty</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Lyrics</th>\n",
       "      <td>0</td>\n",
       "      <td>23</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Machine Learning</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3D</th>\n",
       "      <td>0</td>\n",
       "      <td>22</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>320 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                   num  num2   percent\n",
       "mushap_c                              \n",
       "Mapping           1064  1692  0.628842\n",
       "Social             304   771  0.394293\n",
       "eCommerce          289   630  0.458730\n",
       "Music              259   653  0.396631\n",
       "Photos             251   549  0.457195\n",
       "...                ...   ...       ...\n",
       "Location             0     8  0.000000\n",
       "Loyalty              0     1  0.000000\n",
       "Lyrics               0    23  0.000000\n",
       "Machine Learning     0     1  0.000000\n",
       "3D                   0    22  0.000000\n",
       "\n",
       "[320 rows x 3 columns]"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt8 = dt1.groupby(['mushap_c'])[['num','num2']].sum()\n",
    "dt8 = dt8.sort_values('num',ascending=False)\n",
    "dt8['percent'] = dt8['num']/ dt8['num2']\n",
    "dt8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "id": "9af9de55",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>num</th>\n",
       "      <th>num2</th>\n",
       "      <th>percent</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mushap_c</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Blockchain</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Nutrition</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mail</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Electronic Signature</th>\n",
       "      <td>88</td>\n",
       "      <td>99</td>\n",
       "      <td>0.888889</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mapping</th>\n",
       "      <td>1064</td>\n",
       "      <td>1692</td>\n",
       "      <td>0.628842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Telephony</th>\n",
       "      <td>79</td>\n",
       "      <td>148</td>\n",
       "      <td>0.533784</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Spam</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Calendars</th>\n",
       "      <td>11</td>\n",
       "      <td>22</td>\n",
       "      <td>0.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Fax</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Goals</th>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>0.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Internet of Things</th>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>0.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Payments</th>\n",
       "      <td>6</td>\n",
       "      <td>12</td>\n",
       "      <td>0.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Project Management</th>\n",
       "      <td>6</td>\n",
       "      <td>13</td>\n",
       "      <td>0.461538</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>eCommerce</th>\n",
       "      <td>289</td>\n",
       "      <td>630</td>\n",
       "      <td>0.458730</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Video</th>\n",
       "      <td>188</td>\n",
       "      <td>411</td>\n",
       "      <td>0.457421</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Photos</th>\n",
       "      <td>251</td>\n",
       "      <td>549</td>\n",
       "      <td>0.457195</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Translation</th>\n",
       "      <td>8</td>\n",
       "      <td>19</td>\n",
       "      <td>0.421053</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Forms</th>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>0.400000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bots</th>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>0.400000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Music</th>\n",
       "      <td>259</td>\n",
       "      <td>653</td>\n",
       "      <td>0.396631</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       num  num2   percent\n",
       "mushap_c                                  \n",
       "Blockchain               1     1  1.000000\n",
       "Nutrition                1     1  1.000000\n",
       "Mail                     1     1  1.000000\n",
       "Electronic Signature    88    99  0.888889\n",
       "Mapping               1064  1692  0.628842\n",
       "Telephony               79   148  0.533784\n",
       "Spam                     1     2  0.500000\n",
       "Calendars               11    22  0.500000\n",
       "Fax                      1     2  0.500000\n",
       "Goals                    2     4  0.500000\n",
       "Internet of Things       2     4  0.500000\n",
       "Payments                 6    12  0.500000\n",
       "Project Management       6    13  0.461538\n",
       "eCommerce              289   630  0.458730\n",
       "Video                  188   411  0.457421\n",
       "Photos                 251   549  0.457195\n",
       "Translation              8    19  0.421053\n",
       "Forms                    2     5  0.400000\n",
       "Bots                     2     5  0.400000\n",
       "Music                  259   653  0.396631"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt8_p = dt8.sort_values('percent',ascending=False)\n",
    "dt8_p[:20]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "id": "3a5bac88",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['Blockchain', 'Nutrition', 'Mail', 'Electronic Signature',\n",
       "       'Mapping', 'Telephony', 'Spam', 'Calendars', 'Fax', 'Goals',\n",
       "       'Internet of Things', 'Payments', 'Project Management',\n",
       "       'eCommerce', 'Video', 'Photos', 'Translation', 'Forms', 'Bots',\n",
       "       'Music'], dtype=object)"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt8_p[:20].index.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "id": "7bc9c717",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "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\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<Figure size 432x288 with 0 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from matplotlib import rcParams\n",
    "rcParams['font.family'] = rcParams['font.sans-serif'] = 'SimHei'\n",
    "#设置中文支持,中文字体为简体黑体\n",
    "ax = plt.figure().add_subplot()#建图，获取子图对象ax\n",
    "xx = dt8_p[:20].index.values\n",
    "yy = dt8_p.iloc[:20]['percent']\n",
    "ax.bar(x = xx,height = yy, width = 0.1)\n",
    "ax.set_title ('不同类别下关联度')#设置标题\n",
    "plt.show()#显示绘图结果\n",
    "plt.savefig(\"work2_top20.png\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "25cc83f4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>num</th>\n",
       "      <th>num2</th>\n",
       "      <th>percent</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mushap_c</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Mapping</th>\n",
       "      <td>1064</td>\n",
       "      <td>1692</td>\n",
       "      <td>0.628842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Social</th>\n",
       "      <td>304</td>\n",
       "      <td>771</td>\n",
       "      <td>0.394293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>eCommerce</th>\n",
       "      <td>289</td>\n",
       "      <td>630</td>\n",
       "      <td>0.458730</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Music</th>\n",
       "      <td>259</td>\n",
       "      <td>653</td>\n",
       "      <td>0.396631</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Photos</th>\n",
       "      <td>251</td>\n",
       "      <td>549</td>\n",
       "      <td>0.457195</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Video</th>\n",
       "      <td>188</td>\n",
       "      <td>411</td>\n",
       "      <td>0.457421</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Search</th>\n",
       "      <td>168</td>\n",
       "      <td>682</td>\n",
       "      <td>0.246334</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Electronic Signature</th>\n",
       "      <td>88</td>\n",
       "      <td>99</td>\n",
       "      <td>0.888889</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Telephony</th>\n",
       "      <td>79</td>\n",
       "      <td>148</td>\n",
       "      <td>0.533784</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Messaging</th>\n",
       "      <td>65</td>\n",
       "      <td>257</td>\n",
       "      <td>0.252918</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Travel</th>\n",
       "      <td>49</td>\n",
       "      <td>382</td>\n",
       "      <td>0.128272</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Widgets</th>\n",
       "      <td>45</td>\n",
       "      <td>148</td>\n",
       "      <td>0.304054</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>News Services</th>\n",
       "      <td>31</td>\n",
       "      <td>281</td>\n",
       "      <td>0.110320</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Jobs</th>\n",
       "      <td>31</td>\n",
       "      <td>87</td>\n",
       "      <td>0.356322</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weather</th>\n",
       "      <td>28</td>\n",
       "      <td>113</td>\n",
       "      <td>0.247788</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bookmarks</th>\n",
       "      <td>27</td>\n",
       "      <td>87</td>\n",
       "      <td>0.310345</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Sports</th>\n",
       "      <td>25</td>\n",
       "      <td>195</td>\n",
       "      <td>0.128205</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Government</th>\n",
       "      <td>25</td>\n",
       "      <td>98</td>\n",
       "      <td>0.255102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Real Estate</th>\n",
       "      <td>22</td>\n",
       "      <td>138</td>\n",
       "      <td>0.159420</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Events</th>\n",
       "      <td>22</td>\n",
       "      <td>130</td>\n",
       "      <td>0.169231</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       num  num2   percent\n",
       "mushap_c                                  \n",
       "Mapping               1064  1692  0.628842\n",
       "Social                 304   771  0.394293\n",
       "eCommerce              289   630  0.458730\n",
       "Music                  259   653  0.396631\n",
       "Photos                 251   549  0.457195\n",
       "Video                  188   411  0.457421\n",
       "Search                 168   682  0.246334\n",
       "Electronic Signature    88    99  0.888889\n",
       "Telephony               79   148  0.533784\n",
       "Messaging               65   257  0.252918\n",
       "Travel                  49   382  0.128272\n",
       "Widgets                 45   148  0.304054\n",
       "News Services           31   281  0.110320\n",
       "Jobs                    31    87  0.356322\n",
       "Weather                 28   113  0.247788\n",
       "Bookmarks               27    87  0.310345\n",
       "Sports                  25   195  0.128205\n",
       "Government              25    98  0.255102\n",
       "Real Estate             22   138  0.159420\n",
       "Events                  22   130  0.169231"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt8.iloc[:20]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "689d3a8b",
   "metadata": {},
   "outputs": [],
   "source": [
    "dt = dt1.groupby(['source'])[['num','num2']].sum()\n",
    "dt7 = dt.sort_values('num',ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "c3683b1e",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>num</th>\n",
       "      <th>num2</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>source</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Mashup: Gawkk.com</th>\n",
       "      <td>14</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: Pixelpipe</th>\n",
       "      <td>11</td>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: Sociotoco Search</th>\n",
       "      <td>10</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: G4ng</th>\n",
       "      <td>9</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: Your Mapper</th>\n",
       "      <td>8</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: LocAlerts</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: LocaFollow</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: Locago</th>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: Local Area Info from Zillow Widget</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mashup: zangoa</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>6071 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            num  num2\n",
       "source                                               \n",
       "Mashup: Gawkk.com                            14    23\n",
       "Mashup: Pixelpipe                            11    28\n",
       "Mashup: Sociotoco Search                     10    24\n",
       "Mashup: G4ng                                  9    20\n",
       "Mashup: Your Mapper                           8    17\n",
       "...                                         ...   ...\n",
       "Mashup: LocAlerts                             0     3\n",
       "Mashup: LocaFollow                            0     3\n",
       "Mashup: Locago                                0     5\n",
       "Mashup: Local Area Info from Zillow Widget    0     1\n",
       "Mashup: zangoa                                0     1\n",
       "\n",
       "[6071 rows x 2 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt7"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4ee684ba",
   "metadata": {},
   "source": [
    "### 问题3\n",
    "从非功能视角（例如API之间的兼容性，Web API不同的服务接口协议REST、RPC），对功能类别相等的若干 Web API进行分析（ Web API Tag 标注值 或者 Web API 所属 Category 类别相等）。在Tag 取值相等 或者 Category取值相等的Web API集合内，统计API被使用的情况，尝试从非功能视角进行原因分析（例如API之间的兼容性，Web API不同的服务接口协议REST、RPC） 注：API之间的兼容性是指 历史上共同被调用的情况。如果有过共同调用的记录，说明这两个API兼容"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "27fc5ce5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>source</th>\n",
       "      <th>target</th>\n",
       "      <th>mushap_c</th>\n",
       "      <th>api_c</th>\n",
       "      <th>num</th>\n",
       "      <th>num2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Mashup: CouponRoots</td>\n",
       "      <td>/api/coupon</td>\n",
       "      <td>Coupons</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Mashup: Raise the Money</td>\n",
       "      <td>/api/nationbuilder</td>\n",
       "      <td>Funding</td>\n",
       "      <td>Social</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Mashup: AnythingToHTML</td>\n",
       "      <td>/api/hpe-haven-ondemand-view-document</td>\n",
       "      <td>Documents</td>\n",
       "      <td>Documents</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Mashup: Velocipedia</td>\n",
       "      <td>/api/mapbox</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Mashup: Api Expert - MyMemory Language Translator</td>\n",
       "      <td>/api/mymemory</td>\n",
       "      <td>Translation</td>\n",
       "      <td>Tools</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12609</th>\n",
       "      <td>Mashup: Libraries411</td>\n",
       "      <td>/api/geocoder</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12610</th>\n",
       "      <td>Mashup: Libraries411</td>\n",
       "      <td>/api/geocoderca</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12611</th>\n",
       "      <td>Mashup: National Geographic Map Machine</td>\n",
       "      <td>/api/globexplorer</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12612</th>\n",
       "      <td>Mashup: Splashr</td>\n",
       "      <td>/api/flickr</td>\n",
       "      <td>Photos</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12613</th>\n",
       "      <td>Mashup: Smarkets</td>\n",
       "      <td>/api/amazon-product-advertising</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>12614 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  source  \\\n",
       "0                                    Mashup: CouponRoots   \n",
       "1                                Mashup: Raise the Money   \n",
       "2                                 Mashup: AnythingToHTML   \n",
       "3                                    Mashup: Velocipedia   \n",
       "4      Mashup: Api Expert - MyMemory Language Translator   \n",
       "...                                                  ...   \n",
       "12609                               Mashup: Libraries411   \n",
       "12610                               Mashup: Libraries411   \n",
       "12611            Mashup: National Geographic Map Machine   \n",
       "12612                                    Mashup: Splashr   \n",
       "12613                                   Mashup: Smarkets   \n",
       "\n",
       "                                      target     mushap_c      api_c  num  \\\n",
       "0                                /api/coupon      Coupons        NaN    0   \n",
       "1                         /api/nationbuilder      Funding     Social    0   \n",
       "2      /api/hpe-haven-ondemand-view-document    Documents  Documents    1   \n",
       "3                                /api/mapbox      Mapping    Mapping    1   \n",
       "4                              /api/mymemory  Translation      Tools    0   \n",
       "...                                      ...          ...        ...  ...   \n",
       "12609                          /api/geocoder      Mapping    Mapping    1   \n",
       "12610                        /api/geocoderca      Mapping    Mapping    1   \n",
       "12611                      /api/globexplorer      Mapping    Mapping    1   \n",
       "12612                            /api/flickr       Photos     Photos    1   \n",
       "12613        /api/amazon-product-advertising    eCommerce  eCommerce    1   \n",
       "\n",
       "       num2  \n",
       "0         1  \n",
       "1         1  \n",
       "2         1  \n",
       "3         1  \n",
       "4         1  \n",
       "...     ...  \n",
       "12609     1  \n",
       "12610     1  \n",
       "12611     1  \n",
       "12612     1  \n",
       "12613     1  \n",
       "\n",
       "[12614 rows x 6 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "6b6905f9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'/api/google-maps': 2305,\n",
       " '/api/twitter': 1809,\n",
       " '/api/flickr': 1503,\n",
       " '/api/youtube': 1720,\n",
       " '/api/facebook': 1381,\n",
       " '/api/twilio': 357,\n",
       " '/api/twilio-sms': 283,\n",
       " '/api/lastfm': 665,\n",
       " '/api/amazon-product-advertising': 778,\n",
       " '/api/ebay': 510,\n",
       " '/api/yahoo-geocoding': 192,\n",
       " '/api/geonames': 279,\n",
       " '/api/delicious-0': 430,\n",
       " '/api/google-adsense': 424,\n",
       " '/api/google-search': 480,\n",
       " '/api/yahoo-search': 405,\n",
       " '/api/panoramio': 232,\n",
       " '/api/foursquare': 411,\n",
       " '/api/google-maps-data': 180,\n",
       " '/api/google-earth': 179,\n",
       " '/api/geocoder': 99,\n",
       " '/api/yelp-fusion': 286,\n",
       " '/api/linkedin': 351,\n",
       " '/api/technorati': 228,\n",
       " '/api/wikipedia': 308,\n",
       " '/api/amazon-s3': 311,\n",
       " '/api/amazon-ec2': 204,\n",
       " '/api/google-chart': 229,\n",
       " '/api/google-geocoding': 156,\n",
       " '/api/microsoft-bing-maps': 131,\n",
       " '/api/yahoo-maps': 174,\n",
       " '/api/yahoo-local-search': 107,\n",
       " '/api/digg': 279,\n",
       " '/api/google-base': 164,\n",
       " '/api/twitpic': 159,\n",
       " '/api/yahoo-image-search': 168,\n",
       " '/api/google-picasa': 239,\n",
       " '/api/musicbrainz': 126,\n",
       " '/api/google-app-engine': 248,\n",
       " '/api/vimeo': 286,\n",
       " '/api/google-static-maps': 129,\n",
       " '/api/bitly': 154,\n",
       " '/api/google-analytics-managment': 334,\n",
       " '/api/eventful': 185,\n",
       " '/api/bing': 286,\n",
       " '/api/oodle': 93,\n",
       " '/api/commission-junction': 119,\n",
       " '/api/shoppingcom': 106,\n",
       " '/api/yahoo-video-search': 85,\n",
       " '/api/facebook-graph': 196,\n",
       " '/api/upcomingorg': 127,\n",
       " '/api/weather-channel': 139,\n",
       " '/api/instagram-graph': 220,\n",
       " '/api/spotify-metadata': 59,\n",
       " '/api/google-adwords': 147,\n",
       " '/api/google-fusion-tables': 53,\n",
       " '/api/indeed': 69,\n",
       " '/api/friendfeed': 183,\n",
       " '/api/tumblr': 151,\n",
       " '/api/lyricwiki': 57,\n",
       " '/api/google-maps-places': 88,\n",
       " '/api/myspace': 157,\n",
       " '/api/google-plus': 133,\n",
       " '/api/photobucket': 99,\n",
       " '/api/yahoo-shopping': 45,\n",
       " '/api/soundcloud': 142,\n",
       " '/api/freebase': 108,\n",
       " '/api/yahoo-answers': 100,\n",
       " '/api/google-cloud-translation': 127,\n",
       " '/api/openstreetmap': 72,\n",
       " '/api/microsoft-bing': 72,\n",
       " '/api/blogger': 163,\n",
       " '/api/gowalla': 72,\n",
       " '/api/linkshare': 40,\n",
       " '/api/google-maps-elevation': 67,\n",
       " '/api/google-calendar': 135,\n",
       " '/api/smugmug': 83,\n",
       " '/api/google-maps-flash': 57,\n",
       " '/api/google-custom-search': 134,\n",
       " '/api/facebook-social-plugins': 128,\n",
       " '/api/zillow': 68,\n",
       " '/api/noaa-national-weather-service-nws-ndfd-soap': 25,\n",
       " '/api/aol-video': 109,\n",
       " '/api/citygrid': 72,\n",
       " '/api/shopzilla': 69,\n",
       " '/api/feedburner': 138,\n",
       " '/api/bing-maps': 93,\n",
       " '/api/google-visualization': 77,\n",
       " '/api/hostipinfo': 25,\n",
       " '/api/fedex': 76,\n",
       " '/api/usps-trackconfirm-fields': 65,\n",
       " '/api/ups-shipping': 55,\n",
       " '/api/netflix': 95,\n",
       " '/api/sendgrid': 53,\n",
       " '/api/google-gadgets': 100,\n",
       " '/api/maplarge': 17,\n",
       " '/api/reddit': 93,\n",
       " '/api/yahoo-related-suggestions': 35,\n",
       " '/api/yahoo-term-extraction': 47,\n",
       " '/api/bbc': 73,\n",
       " '/api/jaiku': 33,\n",
       " '/api/itunes-and-itunes-connect': 80,\n",
       " '/api/paypal': 148,\n",
       " '/api/openlayers': 48,\n",
       " '/api/google-webmaster-tools': 95,\n",
       " '/api/livevideo': 53,\n",
       " '/api/thomson-reuters-open-calais': 37,\n",
       " '/api/klout': 56,\n",
       " '/api/pinterest-domain': 40,\n",
       " '/api/best-buy-products': 35,\n",
       " '/api/github': 90,\n",
       " '/api/google-talk': 98,\n",
       " '/api/google-street-view-image': 29,\n",
       " '/api/dropbox': 112,\n",
       " '/api/box': 119,\n",
       " '/api/mtv': 50,\n",
       " '/api/zvents': 32,\n",
       " '/api/bigtribe': 7,\n",
       " '/api/heroku': 47,\n",
       " '/api/geocoderca': 35,\n",
       " '/api/google-gears-geolocation': 62,\n",
       " '/api/fire-eagle': 32,\n",
       " '/api/google-desktop': 15,\n",
       " '/api/rotten-tomatoes': 40,\n",
       " '/api/withings': 22,\n",
       " '/api/fitbit': 46,\n",
       " '/api/crunchbase': 65,\n",
       " '/api/dailymotion': 40,\n",
       " '/api/yahoo-traffic': 51,\n",
       " '/api/msn-messenger': 32,\n",
       " '/api/23': 61,\n",
       " '/api/trynt': 13,\n",
       " '/api/what-trend': 9,\n",
       " '/api/cnet': 65,\n",
       " '/api/vast': 25,\n",
       " '/api/google-mashup-editor': 26,\n",
       " '/api/alexa-web-information-service': 39,\n",
       " '/api/compete': 44,\n",
       " '/api/google-drive': 66,\n",
       " '/api/walk-score': 25,\n",
       " '/api/google-latitude': 34,\n",
       " '/api/google-directions': 37,\n",
       " '/api/mobypicture': 47,\n",
       " '/api/shopify-admin': 52,\n",
       " '/api/magento-soap': 58,\n",
       " '/api/hotelscombined': 18,\n",
       " '/api/slideshare': 67,\n",
       " '/api/kayak': 40,\n",
       " '/api/tweetphoto': 51,\n",
       " '/api/google-openid': 56,\n",
       " '/api/veoh': 28,\n",
       " '/api/411sync': 41,\n",
       " '/api/bebo': 79,\n",
       " '/api/zooomr': 57,\n",
       " '/api/yahoo-boss': 0,\n",
       " '/api/twitter-streaming': 25,\n",
       " '/api/etsy': 70,\n",
       " '/api/google-spreadsheets': 49,\n",
       " '/api/google-contacts': 88,\n",
       " '/api/google-gmail-oauth': 64,\n",
       " '/api/world-weather-online': 37,\n",
       " '/api/bbc-music': 31,\n",
       " '/api/songkick': 57,\n",
       " '/api/trulia': 18,\n",
       " '/api/yahoo-query-language-graphql': 42,\n",
       " '/api/stripe': 22,\n",
       " '/api/goodreads': 43,\n",
       " '/api/magnolia': 11,\n",
       " '/api/cafe-press': 59,\n",
       " '/api/amazon-rds-relational-database-service': 27,\n",
       " '/api/new-york-times-article-search': 22,\n",
       " '/api/dbpedia': 73,\n",
       " '/api/pownce': 46,\n",
       " '/api/google-documents-list': 63,\n",
       " '/api/google-checkout': 51,\n",
       " '/api/facebook-real-time-updates': 33,\n",
       " '/api/bigcommerce': 40,\n",
       " '/api/movie-database-tmdb': 21,\n",
       " '/api/yahoo-internet-location-platform': 14,\n",
       " '/api/google-buzz': 69,\n",
       " '/api/addthis-menu': 50,\n",
       " '/api/meetup': 35,\n",
       " '/api/microsoft-mappoint': 6,\n",
       " '/api/riya': 17,\n",
       " '/api/grouper-video': 26,\n",
       " '/api/social-share-count': 53,\n",
       " '/api/hyves': 45,\n",
       " '/api/amazon-marketplace-web-service': 43,\n",
       " '/api/sletohcom': 4,\n",
       " '/api/bing-maps-search': 30,\n",
       " '/api/bing-maps-locations': 22,\n",
       " '/api/bandsintown': 42,\n",
       " '/api/hoiio-sms': 6,\n",
       " '/api/hoiio-voice': 10,\n",
       " '/api/sugarsync': 34,\n",
       " '/api/picplz': 43,\n",
       " '/api/ontok': 10,\n",
       " '/api/pricerunner': 16,\n",
       " '/api/opensecrets': 19,\n",
       " '/api/govtrackus': 13,\n",
       " '/api/mt-gox': 16,\n",
       " '/api/bitstamp-http': 20,\n",
       " '/api/yahoo-site-explorer': 24,\n",
       " '/api/your-mapper': 23,\n",
       " '/api/loxcel': 8,\n",
       " '/api/runkeeper-health-graph': 23,\n",
       " '/api/windows-live-spaces': 33,\n",
       " '/api/microsoft-silverlight-streaming': 13,\n",
       " '/api/windows-live-contacts-control': 2,\n",
       " '/api/google-friend-connect': 16,\n",
       " '/api/google-client-authentication': 36,\n",
       " '/api/topsy': 11,\n",
       " '/api/yahoo-map-image': 15,\n",
       " '/api/rhapsody': 19,\n",
       " '/api/hi5': 43,\n",
       " '/api/imeem': 53,\n",
       " '/api/webshots': 41,\n",
       " '/api/jawbone': 13,\n",
       " '/api/new-york-times-best-sellers': 16,\n",
       " '/api/twittercounter': 16,\n",
       " '/api/bliptv': 25,\n",
       " '/api/viddler': 66,\n",
       " '/api/ebay-finding': 32,\n",
       " '/api/disqus': 12,\n",
       " '/api/twittervision': 7,\n",
       " '/api/dapper': 10,\n",
       " '/api/gigablast': 5,\n",
       " '/api/twitgoo': 25,\n",
       " '/api/yahoo-mail': 30,\n",
       " '/api/chartlyrics-lyric': 29,\n",
       " '/api/billboard': 19,\n",
       " '/api/yahoo-travel': 31,\n",
       " '/api/friendster': 69,\n",
       " '/api/discogs': 21,\n",
       " '/api/google-books': 50,\n",
       " '/api/adobe-air-bus-tour': 5,\n",
       " '/api/identica': 7,\n",
       " '/api/ipernity': 49,\n",
       " '/api/findory': 41,\n",
       " '/api/skype': 31,\n",
       " '/api/typepad': 55,\n",
       " '/api/ebay-shopping': 21,\n",
       " '/api/raw-sugar': 14,\n",
       " '/api/guardian': 21,\n",
       " '/api/walmart-open': 9,\n",
       " '/api/amazon-simpledb': 12,\n",
       " '/api/amazon-a9-opensearch': 59,\n",
       " '/api/getglue': 24,\n",
       " '/api/yipit': 19,\n",
       " '/api/500px': 18,\n",
       " '/api/aol-instant-messenger': 13,\n",
       " '/api/yahoo-messenger': 10,\n",
       " '/api/plaxo': 20,\n",
       " '/api/itunes-app-store-search': 42,\n",
       " '/api/openweathermap': 28,\n",
       " '/api/mapquest': 15,\n",
       " '/api/basecamp': 24,\n",
       " '/api/blinksale': 11,\n",
       " '/api/shadows': 10,\n",
       " '/api/bloglines': 5,\n",
       " '/api/yahoo-music': 48,\n",
       " '/api/gruvr': 32,\n",
       " '/api/pricegrabber': 17,\n",
       " '/api/factual-v3': 27,\n",
       " '/api/yahoo-placemaker': 4,\n",
       " '/api/mybloglog': 19,\n",
       " '/api/backtweets': 12,\n",
       " '/api/lat49': 4,\n",
       " '/api/bookmooch': 12,\n",
       " '/api/syndic8': 41,\n",
       " '/api/amazon-cloudwatch': 21,\n",
       " '/api/evri': 11,\n",
       " '/api/google-shopping-search': 30,\n",
       " '/api/urban-mapping-mapfluence': 13,\n",
       " '/api/yahoo-weather': 65,\n",
       " '/api/google-play-developer': 12,\n",
       " '/api/instagram-real-time': 4,\n",
       " '/api/channeladvisor': 32,\n",
       " '/api/yes-broadcast-db': 7,\n",
       " '/api/expedia': 31,\n",
       " '/api/dhl': 20,\n",
       " '/api/evernote': 39,\n",
       " '/api/8coupons': 6,\n",
       " '/api/groupon': 30,\n",
       " '/api/myvox': 14,\n",
       " '/api/zendesk-core': 19,\n",
       " '/api/backtype': 37,\n",
       " '/api/google-single-signon': 47,\n",
       " '/api/tripit': 24,\n",
       " '/api/mailchimp': 48,\n",
       " '/api/rovi-cloud-services': 12,\n",
       " '/api/google-distance-matrix': 10,\n",
       " '/api/howcast': 45,\n",
       " '/api/livejournal': 20,\n",
       " '/api/buffer': 50,\n",
       " '/api/instapaper': 51,\n",
       " '/api/pocket': 50,\n",
       " '/api/adobe-share': 51,\n",
       " '/api/google-book-search-book-viewability': 4,\n",
       " '/api/imageshack': 16,\n",
       " '/api/scribd-platform': 16,\n",
       " '/api/longurl': 14,\n",
       " '/api/buzznet': 52,\n",
       " '/api/blinkx': 43,\n",
       " '/api/opensocial': 27,\n",
       " '/api/seesmic': 54,\n",
       " '/api/addthis-sharing-endpoints': 7,\n",
       " '/api/iva-video': 8,\n",
       " '/api/shizzow': 3,\n",
       " '/api/careerjet': 10,\n",
       " '/api/tropo-scripting': 15,\n",
       " '/api/clearforest-semantic-web-services1': 8,\n",
       " '/api/woocommerce': 21,\n",
       " '/api/musixmatch': 8,\n",
       " '/api/careerbuilder': 11,\n",
       " '/api/kiva': 2,\n",
       " '/api/tinysong': 19,\n",
       " '/api/orkut': 16,\n",
       " '/api/gravatar': 60,\n",
       " '/api/map24-ajax': 8,\n",
       " '/api/peerindex': 12,\n",
       " '/api/yahoo-search-marketing': 8,\n",
       " '/api/futef-wikipedia-api': 22,\n",
       " '/api/netvibes': 62,\n",
       " '/api/newsgator': 33,\n",
       " '/api/google-wave': 15,\n",
       " '/api/yahoo-audio-search': 11,\n",
       " '/api/new-york-times-newswire': 15,\n",
       " '/api/wordpressorg': 14,\n",
       " '/api/amazon-queue-service': 8,\n",
       " '/api/janrain-engage': 12,\n",
       " '/api/zemanta': 14,\n",
       " '/api/google-social-graph': 13,\n",
       " '/api/yahoo-widgets': 32,\n",
       " '/api/digital-podcast': 5,\n",
       " '/api/geoiq': 0,\n",
       " '/api/brightkite': 0,\n",
       " '/api/weatherbug': 0,\n",
       " '/api/sunlight-labs-congress': 0,\n",
       " '/api/backpack': 7,\n",
       " '/api/43things': 30,\n",
       " '/api/thumbalizr': 18,\n",
       " '/api/pixlr': 20,\n",
       " '/api/aol-open-mail': 4,\n",
       " '/api/aol-open-auth': 5,\n",
       " '/api/att-call-management': 2,\n",
       " '/api/att-app-messaging': 10,\n",
       " '/api/30-boxes': 3,\n",
       " '/api/ohloh': 27,\n",
       " '/api/pushover-message': 8,\n",
       " '/api/zanox': 16,\n",
       " '/api/tailrank': 11,\n",
       " '/api/juju-publisher': 9,\n",
       " '/api/amplify': 5,\n",
       " '/api/seomoz': 15,\n",
       " '/api/google-page-speed-online': 8,\n",
       " '/api/mandrill': 15,\n",
       " '/api/bing-maps-routes': 7,\n",
       " '/api/true-knowledge': 11,\n",
       " '/api/sears': 28,\n",
       " '/api/yahoo-my-web-search': 26,\n",
       " '/api/snapr': 8,\n",
       " '/api/steply': 8,\n",
       " '/api/burstn': 8,\n",
       " '/api/tweetmeme': 21,\n",
       " '/api/shareasale-affiliate': 7,\n",
       " '/api/kewego-video': 9,\n",
       " '/api/donorschoose': 11,\n",
       " '/api/global-biodiversity-information-facility': 2,\n",
       " '/api/coindesk': 6,\n",
       " '/api/coinbase': 20,\n",
       " '/api/social-archive': 33,\n",
       " '/api/blankslate': 11,\n",
       " '/api/we-feel-fine': 3,\n",
       " '/api/google-fonts': 25,\n",
       " '/api/librarything': 11,\n",
       " '/api/google-translator-toolkit': 23,\n",
       " '/api/weather-underground-wunderground': 13,\n",
       " '/api/strikeiron-ip-address-lookup': 6,\n",
       " '/api/noaa-climate-data-online': 13,\n",
       " '/api/prosperent': 8,\n",
       " '/api/mixpanel': 18,\n",
       " '/api/mapmyfitness': 11,\n",
       " '/api/new-relic': 28,\n",
       " '/api/strava': 12,\n",
       " '/api/airbrake': 17,\n",
       " '/api/tagalus': 4,\n",
       " '/api/aviary-suite': 8,\n",
       " '/api/capitol-words': 12,\n",
       " '/api/skyhook-precision-location': 20,\n",
       " '/api/windows-live-expo': 22,\n",
       " '/api/windows-live-contacts': 9,\n",
       " '/api/windows-live-data': 5,\n",
       " '/api/google-apps-email-migration': 25,\n",
       " '/api/mapfluence': 4,\n",
       " '/api/elasticsearch': 13,\n",
       " '/api/digitalocean': 20,\n",
       " '/api/yahoo-geoplanet': 14,\n",
       " '/api/new-york-times-movie-reviews': 29,\n",
       " '/api/videosurf': 29,\n",
       " '/api/yahoo-ads': 2,\n",
       " '/api/adility': 4,\n",
       " '/api/retailmenotcom-community-ideas': 4,\n",
       " '/api/dealsurf': 4,\n",
       " '/api/alexa-top-sites': 5,\n",
       " '/api/rapleaf': 7,\n",
       " '/api/authorizenet': 19,\n",
       " '/api/spotify-web': 3,\n",
       " '/api/wahoo-fitness': 7,\n",
       " '/api/google-bigquery': 2,\n",
       " '/api/looker': 2,\n",
       " '/api/freebiesms': 2,\n",
       " '/api/imageloop': 35,\n",
       " '/api/amazon-mechanical-turk': 16,\n",
       " '/api/feedly': 14,\n",
       " '/api/3dcart': 24,\n",
       " '/api/picnik': 16,\n",
       " '/api/giphy': 12,\n",
       " '/api/amadeus': 4,\n",
       " '/api/sabre-0': 3,\n",
       " '/api/garmin-motionbased': 8,\n",
       " '/api/kyte': 49,\n",
       " '/api/ning': 33,\n",
       " '/api/lazytune': 8,\n",
       " '/api/geoportail': 3,\n",
       " '/api/freshbooks': 6,\n",
       " '/api/eventbrite': 28,\n",
       " '/api/imgur': 19,\n",
       " '/api/viamichelin': 4,\n",
       " '/api/google-web-authentication': 17,\n",
       " '/api/vonage-nexmo-sms': 7,\n",
       " '/api/cloudmine': 5,\n",
       " '/api/pubnub-javascript-push': 5,\n",
       " '/api/jamendo': 2,\n",
       " '/api/linkup-job-search-engine': 9,\n",
       " '/api/amazon-fulfillment-web-service': 8,\n",
       " '/api/campaign-monitor': 4,\n",
       " '/api/watchmouse': 8,\n",
       " '/api/yandex': 34,\n",
       " '/api/aviary-web': 8,\n",
       " '/api/bandcamp': 8,\n",
       " '/api/ip2location': 5,\n",
       " '/api/google-affiliate-network': 15,\n",
       " '/api/outsidein': 18,\n",
       " '/api/townme-geo': 6,\n",
       " '/api/mapbox': 17,\n",
       " '/api/metacarta': 4,\n",
       " '/api/tiny-url-open': 21,\n",
       " '/api/webthumb': 20,\n",
       " '/api/google-gears': 9,\n",
       " '/api/scoopit': 40,\n",
       " '/api/aol-pictures': 34,\n",
       " '/api/phanfare': 35,\n",
       " '/api/zazzle': 14,\n",
       " '/api/amazon-flexible-payments-service': 7,\n",
       " '/api/yahoo-music-engine': 3,\n",
       " '/api/myplaylist': 2,\n",
       " '/api/bibsonomy': 4,\n",
       " '/api/mapstraction': 4,\n",
       " '/api/nestoria': 8,\n",
       " '/api/7digital': 11,\n",
       " '/api/social-actions': 2,\n",
       " '/api/ordnance-survey-maps': 5,\n",
       " '/api/highrise': 14,\n",
       " '/api/pikeo': 27,\n",
       " '/api/zoomin': 50,\n",
       " '/api/world-time-engine': 13,\n",
       " '/api/infochimps-social': 3,\n",
       " '/api/plunker': 21,\n",
       " '/api/ebay-product-services': 7,\n",
       " '/api/google-closure-compiler': 21,\n",
       " '/api/alexa-web-search': 5,\n",
       " '/api/quickblox': 3,\n",
       " '/api/readmill': 2,\n",
       " '/api/yahoo-placefinder': 20,\n",
       " '/api/yellow': 2,\n",
       " '/api/wordpresscom': 46,\n",
       " '/api/greatschools': 5,\n",
       " '/api/mendeley': 5,\n",
       " '/api/plos-search': 2,\n",
       " '/api/twitter-search': 5,\n",
       " '/api/semantria': 5,\n",
       " '/api/viralheat': 5,\n",
       " '/api/ihealth': 10,\n",
       " '/api/endicia-label-server': 31,\n",
       " '/api/amazon-ses': 16,\n",
       " '/api/constantcontact': 11,\n",
       " '/api/semantichacker': 7,\n",
       " '/api/lockerz': 19,\n",
       " '/api/feedzilla': 20,\n",
       " '/api/bing-translator': 7,\n",
       " '/api/posterous': 59,\n",
       " '/api/big-huge-thesaurus': 1,\n",
       " '/api/widgetbox': 23,\n",
       " '/api/faviconz': 5,\n",
       " '/api/layar': 7,\n",
       " '/api/simpleapi': 5,\n",
       " '/api/splogspot': 7,\n",
       " '/api/norway-weather': 6,\n",
       " '/api/yahoo-address-book': 13,\n",
       " '/api/galileo': 3,\n",
       " '/api/naver': 10,\n",
       " '/api/ilike': 26,\n",
       " '/api/12secondstv': 1,\n",
       " '/api/twickit': 17,\n",
       " '/api/blipfm': 3,\n",
       " '/api/microsoft-msdn': 13,\n",
       " '/api/pinboard': 51,\n",
       " '/api/readability': 57,\n",
       " '/api/vodpod': 19,\n",
       " '/api/dataunison-ebay-research': 5,\n",
       " '/api/google-storage': 7,\n",
       " '/api/isbn-db': 6,\n",
       " '/api/forrst': 35,\n",
       " '/api/dribbble': 36,\n",
       " '/api/docusign-enterprise': 7,\n",
       " '/api/google-sites': 18,\n",
       " '/api/zenfolio': 22,\n",
       " '/api/springwidgets': 30,\n",
       " '/api/moreover': 31,\n",
       " '/api/pageflakes': 30,\n",
       " '/api/issuu-search': 10,\n",
       " '/api/echosign': 0,\n",
       " '/api/microsoft-adcenter': 6,\n",
       " '/api/windows-live-id-web-authentication': 1,\n",
       " '/api/blogmarks': 0,\n",
       " '/api/hotornot': 0,\n",
       " '/api/bt-web21c': 0,\n",
       " '/api/seeqpod': 0,\n",
       " '/api/grooveshark': 0,\n",
       " '/api/google-email-settings': 0,\n",
       " '/api/salesforce': 0,\n",
       " '/api/strikeiron-us-census': 0,\n",
       " '/api/nasa': 1,\n",
       " '/api/spotify-echo-nest': 0,\n",
       " '/api/worldcat-search': 2,\n",
       " '/api/peekyou-social-analytics': 2,\n",
       " '/api/liveconnect': 1,\n",
       " '/api/embedly': 2,\n",
       " '/api/impact-radius': 4,\n",
       " '/api/microsoft-translator': 4,\n",
       " '/api/fotoflexer': 8,\n",
       " '/api/ribbet': 8,\n",
       " '/api/vk': 13,\n",
       " '/api/slack-real-time-messaging': 1,\n",
       " '/api/99designs-tasks': 1,\n",
       " '/api/amee': 1,\n",
       " '/api/recurly': 2,\n",
       " '/api/national-library-medicine-dirline': 3,\n",
       " '/api/nhs': 3,\n",
       " '/api/strikeiron-sms-mobile-marketing': 1,\n",
       " '/api/brightcove': 7,\n",
       " '/api/openx': 6,\n",
       " '/api/postrank-data-mining': 2,\n",
       " '/api/ifbyphone': 1,\n",
       " '/api/orange-sms': 1,\n",
       " '/api/orange-location': 1,\n",
       " '/api/kraken': 4,\n",
       " '/api/poloniex': 4,\n",
       " '/api/bittrex': 4,\n",
       " '/api/hitbtc': 4,\n",
       " '/api/altmetric': 1,\n",
       " '/api/mozscape': 3,\n",
       " '/api/whoapi': 6,\n",
       " '/api/mobile-phone-megastore': 1,\n",
       " '/api/alchemyapi-text-categorization': 3,\n",
       " '/api/intelepeer': 3,\n",
       " '/api/tokbox': 8,\n",
       " '/api/sensis-business-search': 1,\n",
       " '/api/autodesk-freewheel': 2,\n",
       " '/api/bbc-nitro': 2,\n",
       " '/api/fanarttv-music': 4,\n",
       " '/api/barcelona-bicing': 1,\n",
       " '/api/beer-mapping': 2,\n",
       " '/api/irail': 1,\n",
       " '/api/google-recaptcha': 4,\n",
       " '/api/addthis-services': 10,\n",
       " '/api/upc-database': 9,\n",
       " '/api/hunch': 2,\n",
       " '/api/high-gear-media': 1,\n",
       " '/api/activecom': 24,\n",
       " '/api/socrata-open-data': 7,\n",
       " '/api/alexa-site-thumbnail': 7,\n",
       " '/api/open-government-data-initiative': 2,\n",
       " '/api/ltcoin': 2,\n",
       " '/api/cryptocoin-charts': 2,\n",
       " '/api/bitcoin-charts-markets': 2,\n",
       " '/api/vircurex': 9,\n",
       " '/api/campbx': 9,\n",
       " '/api/bitrix24': 9,\n",
       " '/api/mcxnow': 9,\n",
       " '/api/bitcurex': 9,\n",
       " '/api/cryptsy': 9,\n",
       " '/api/coins-e': 9,\n",
       " '/api/favorit': 14,\n",
       " '/api/singleplatform': 14,\n",
       " '/api/fwix': 14,\n",
       " '/api/yrc': 14,\n",
       " '/api/national-weather-service-ndfd': 1,\n",
       " '/api/simplegeo': 11,\n",
       " '/api/livekick': 8,\n",
       " '/api/direct-textbook': 4,\n",
       " '/api/library-congress-srw': 8,\n",
       " '/api/topicalizer': 1,\n",
       " '/api/open-library-books': 3,\n",
       " '/api/google-safe-browsing': 2,\n",
       " '/api/reuters-spotlight': 2,\n",
       " '/api/google-shopping-content': 18,\n",
       " '/api/yahoo-fantasy-sports': 1,\n",
       " '/api/infogroup-infoconnect': 1,\n",
       " '/api/yahoo-geo-location': 5,\n",
       " '/api/target': 9,\n",
       " '/api/daybreak-game-company-census': 5,\n",
       " '/api/1map': 4,\n",
       " '/api/18amail': 4,\n",
       " '/api/123-shop-pro': 4,\n",
       " '/api/123contactform': 4,\n",
       " '/api/140-proof': 4,\n",
       " '/api/trim': 14,\n",
       " '/api/captchacoin': 1,\n",
       " '/api/securenet': 1,\n",
       " '/api/datagovuk': 2,\n",
       " '/api/uk-street-level-crime': 2,\n",
       " '/api/edmundscom-vehicle': 3,\n",
       " '/api/sdss-imgcutout': 2,\n",
       " '/api/openskyquery-skyportal': 2,\n",
       " '/api/us-census-bureau': 1,\n",
       " '/api/travelport': 1,\n",
       " '/api/travenjoy': 1,\n",
       " '/api/chacha': 4,\n",
       " '/api/imified': 2,\n",
       " '/api/wiki-data': 5,\n",
       " '/api/skimlinks-link-monetization': 7,\n",
       " '/api/parsebot': 7,\n",
       " '/api/mapmyrun': 10,\n",
       " '/api/broadsoft-xtended': 2,\n",
       " '/api/marketo': 13,\n",
       " '/api/cloud-elements-platform': 13,\n",
       " '/api/eloqua': 13,\n",
       " '/api/infobip': 13,\n",
       " '/api/hubspot-leads': 13,\n",
       " '/api/servicenow': 13,\n",
       " '/api/sugarcrm': 17,\n",
       " '/api/batchbook': 2,\n",
       " '/api/drawloop': 2,\n",
       " '/api/google-code-search': 1,\n",
       " '/api/bitfinex': 2,\n",
       " '/api/victoria-albert-museum': 2,\n",
       " '/api/readsocial': 1,\n",
       " '/api/conceptshare': 1,\n",
       " '/api/city-and-state-zip-code': 9,\n",
       " '/api/contextio': 2,\n",
       " '/api/contentful': 1,\n",
       " '/api/rubygems': 25,\n",
       " '/api/numbers': 1,\n",
       " '/api/science-museum': 1,\n",
       " '/api/active': 8,\n",
       " '/api/activ-financial': 2,\n",
       " '/api/actblue': 2,\n",
       " '/api/mailgun': 2,\n",
       " '/api/launchbit': 1,\n",
       " '/api/rentometer': 4,\n",
       " '/api/corpwatch': 1,\n",
       " '/api/central-bank-armenia-exchange-rates': 3,\n",
       " '/api/bank-russia-daily-info': 4,\n",
       " '/api/mnb-exchange-rate': 3,\n",
       " '/api/bitcoinaverage': 3,\n",
       " '/api/urban-mapping-neighborhoods': 3,\n",
       " '/api/whipplehill': 2,\n",
       " '/api/finalsite': 2,\n",
       " '/api/schoology': 2,\n",
       " '/api/awesm': 2,\n",
       " '/api/notifo': 5,\n",
       " '/api/google-civic-information': 4,\n",
       " '/api/filestube': 1,\n",
       " '/api/aerisweather': 1,\n",
       " '/api/handset-detection': 1,\n",
       " '/api/woot': 1,\n",
       " '/api/i-need-bargain': 1,\n",
       " '/api/short-and-tweet': 1,\n",
       " '/api/mindtouch-deki-wiki': 2,\n",
       " '/api/poly9-freeearth': 2,\n",
       " '/api/blue': 1,\n",
       " '/api/onelogin': 5,\n",
       " '/api/datadog': 11,\n",
       " '/api/sms': 11,\n",
       " '/api/bugsnag': 11,\n",
       " '/api/gmail': 15,\n",
       " '/api/circleci': 11,\n",
       " '/api/gitlab': 11,\n",
       " '/api/slack-incoming-webhooks': 11,\n",
       " '/api/hetzner': 11,\n",
       " '/api/fotolia': 5,\n",
       " '/api/wishpot-shopping': 4,\n",
       " '/api/digireality': 3,\n",
       " '/api/finansportalen': 3,\n",
       " '/api/maplight': 2,\n",
       " '/api/follow-money': 2,\n",
       " '/api/movieclipscom': 28,\n",
       " '/api/8tracks': 28,\n",
       " '/api/laravel': 4,\n",
       " '/api/analytics-seo': 4,\n",
       " '/api/dog-gateway': 4,\n",
       " '/api/domaintools': 3,\n",
       " '/api/domain': 3,\n",
       " '/api/dnsimple': 3,\n",
       " '/api/dns-tools': 3,\n",
       " '/api/doodle': 1,\n",
       " '/api/bing-search': 3,\n",
       " '/api/myob-accountright-live': 9,\n",
       " '/api/workflowmax': 9,\n",
       " '/api/google-analytics-core-reporting': 9,\n",
       " '/api/myob-essentials-accounting': 9,\n",
       " '/api/xero': 14,\n",
       " '/api/neto': 9,\n",
       " '/api/quickbooks-payments': 9,\n",
       " '/api/servicem8': 9,\n",
       " '/api/tradegecko': 9,\n",
       " '/api/kounta': 9,\n",
       " '/api/university-british-columbia-labs': 3,\n",
       " '/api/uc-berkeley-registration-status-check': 3,\n",
       " '/api/earth911-search': 1,\n",
       " '/api/editgrid': 1,\n",
       " '/api/tinylink': 4,\n",
       " '/api/eldercare-locator': 2,\n",
       " '/api/usgs-elevation-query-service': 3,\n",
       " '/api/enthusem': 1,\n",
       " '/api/amnesty-international': 2,\n",
       " '/api/europass': 2,\n",
       " '/api/ergast': 1,\n",
       " '/api/datumbox': 5,\n",
       " '/api/anything2pdf': 3,\n",
       " '/api/dezrez': 3,\n",
       " '/api/payment-vision-pay': 2,\n",
       " '/api/paymentwall': 2,\n",
       " '/api/payments-gateway': 2,\n",
       " '/api/sparklines': 3,\n",
       " '/api/creative-commons': 2,\n",
       " '/api/best-buy-reviews': 2,\n",
       " '/api/opinioncrawl-sentiment-analysis': 4,\n",
       " '/api/review-trackers': 2,\n",
       " '/api/pinnaclecart-rest': 4,\n",
       " '/api/pusher': 4,\n",
       " '/api/tfl-cycle-hire': 1,\n",
       " '/api/yahoo-spelling-suggestion': 4,\n",
       " '/api/brewerydb': 3,\n",
       " '/api/heyzap': 4,\n",
       " '/api/uship': 5,\n",
       " '/api/rxnlp-text-similarity': 2,\n",
       " '/api/rxnlp-cluster-sentences-and-short-texts': 2,\n",
       " '/api/omnidrive': 10,\n",
       " '/api/zoominfo': 4,\n",
       " '/api/dailymile': 2,\n",
       " '/api/garmin-communicator-plugin': 1,\n",
       " '/api/ribbit': 2,\n",
       " '/api/harpercollins-open-book': 5,\n",
       " '/api/random-house': 5,\n",
       " '/api/usa-today-best-selling-books': 5,\n",
       " '/api/amazon-dynamodb': 5,\n",
       " '/api/roku-web-service': 4,\n",
       " '/api/formstack': 6,\n",
       " '/api/angellist': 6,\n",
       " '/api/framey': 1,\n",
       " '/api/akismet': 5,\n",
       " '/api/everytrail': 8,\n",
       " '/api/colourlovers': 5,\n",
       " '/api/videodetective': 22,\n",
       " '/api/aol-video-upload': 22,\n",
       " '/api/ooyala-video-player': 22,\n",
       " '/api/joost': 22,\n",
       " '/api/avantlink': 1,\n",
       " '/api/gengo-human-translation': 1,\n",
       " '/api/vine': 6,\n",
       " '/api/paperboy': 6,\n",
       " '/api/quova': 8,\n",
       " '/api/wikilocation': 1,\n",
       " '/api/geocubes': 1,\n",
       " '/api/geograph': 3,\n",
       " '/api/infochimps-geo': 2,\n",
       " '/api/geoloqi': 3,\n",
       " '/api/getsentiment': 1,\n",
       " '/api/webhoseio': 1,\n",
       " '/api/booli': 1,\n",
       " '/api/snocap': 6,\n",
       " '/api/tradeshift': 1,\n",
       " '/api/agendize-action': 2,\n",
       " '/api/kookoo': 3,\n",
       " '/api/brighter-planet-cm1': 2,\n",
       " '/api/groveio': 2,\n",
       " '/api/groups-near-you': 2,\n",
       " '/api/ticketfly-affiliate': 5,\n",
       " '/api/ubio-namebank': 5,\n",
       " '/api/arkive': 5,\n",
       " '/api/natureserve-species': 5,\n",
       " '/api/baidu': 10,\n",
       " '/api/sina-weibo': 4,\n",
       " '/api/telapi': 1,\n",
       " '/api/zapier': 1,\n",
       " '/api/daylife': 8,\n",
       " '/api/faroo': 18,\n",
       " '/api/blekko': 7,\n",
       " '/api/hello-salut': 1,\n",
       " '/api/igoogle-themes': 1,\n",
       " '/api/viator': 4,\n",
       " '/api/bookingcom-content': 3,\n",
       " '/api/kynetx': 3,\n",
       " '/api/qwerly': 20,\n",
       " '/api/fullcontact-person': 1,\n",
       " '/api/product-hunt': 9,\n",
       " '/api/new-york-times-archive': 9,\n",
       " '/api/thetvdbcom': 1,\n",
       " '/api/mywot': 1,\n",
       " '/api/pubnub': 3,\n",
       " '/api/yahoo-bbauth': 10,\n",
       " '/api/tel': 4,\n",
       " '/api/billomat': 2,\n",
       " '/api/mite': 1,\n",
       " '/api/yummly': 2,\n",
       " '/api/jet': 6,\n",
       " '/api/rakuten': 6,\n",
       " '/api/usajobs': 2,\n",
       " '/api/simplyhired-jobs': 2,\n",
       " '/api/miso': 10,\n",
       " '/api/joyrack-games': 1,\n",
       " '/api/sendy': 5,\n",
       " '/api/localschooldirectory': 1,\n",
       " '/api/govdata': 1,\n",
       " '/api/linode': 10,\n",
       " '/api/hp-labs-multimedia-analytic-platform': 4,\n",
       " '/api/kissmetrics': 1,\n",
       " '/api/facebook-credits': 4,\n",
       " '/api/facebook-chat': 4,\n",
       " '/api/superfeedr': 3,\n",
       " '/api/kwwika': 1,\n",
       " '/api/nationbuilder': 1,\n",
       " '/api/spokenbuzz': 2,\n",
       " '/api/gecko-landmarks': 1,\n",
       " '/api/cloudspeakers': 1,\n",
       " '/api/fring': 2,\n",
       " '/api/pebble': 1,\n",
       " '/api/levelup': 1,\n",
       " '/api/secondlife': 7,\n",
       " '/api/appharbor': 1,\n",
       " '/api/open-movie-database': 5,\n",
       " '/api/wolfram-alpha': 12,\n",
       " '/api/opencnam': 5,\n",
       " '/api/semantic-contextual-advertising': 1,\n",
       " '/api/sensebot': 4,\n",
       " '/api/aviary-effects': 6,\n",
       " '/api/medianet-open-mp3': 5,\n",
       " '/api/untappd': 11,\n",
       " '/api/tweet-press': 10,\n",
       " '/api/tweetsentiments': 10,\n",
       " '/api/tweetarun': 10,\n",
       " '/api/tweepsearch': 10,\n",
       " '/api/tweetfeel-twitter-sentiment': 10,\n",
       " '/api/tweetrl': 10,\n",
       " '/api/tweetlater': 10,\n",
       " '/api/tweetshrink': 10,\n",
       " '/api/ipinfoio-ip-geolocation': 1,\n",
       " '/api/localmind': 3,\n",
       " '/api/espn': 7,\n",
       " '/api/fanfeedr-sports-news': 3,\n",
       " '/api/fwix-location': 8,\n",
       " '/api/ip-apicom-geolocation': 3,\n",
       " '/api/hipchat': 2,\n",
       " '/api/lyricfind': 4,\n",
       " '/api/langid': 13,\n",
       " '/api/lyrdb': 14,\n",
       " '/api/are-you-watching': 4,\n",
       " '/api/bing-traffic': 4,\n",
       " '/api/artistdata': 4,\n",
       " '/api/clockwork-sms': 7,\n",
       " '/api/business-alerts': 1,\n",
       " '/api/business-profiles': 1,\n",
       " '/api/bing-maps-geocode-dataflow': 4,\n",
       " '/api/scribble-maps': 2,\n",
       " '/api/biodiversity-heritage-library': 1,\n",
       " '/api/theyworkforyou': 2,\n",
       " '/api/whereis': 1,\n",
       " '/api/cloudmade-leaflet': 8,\n",
       " '/api/weblogs': 10,\n",
       " '/api/nasa-mars-rover-photos': 1,\n",
       " '/api/maas2': 1,\n",
       " '/api/venmo': 1,\n",
       " '/api/meaningtool': 2,\n",
       " '/api/oovoo': 1,\n",
       " '/api/thrutu': 5,\n",
       " '/api/dwolla': 1,\n",
       " '/api/open-garden': 4,\n",
       " '/api/facescom': 8,\n",
       " '/api/amazon-sns': 7,\n",
       " '/api/planning-center': 7,\n",
       " '/api/softlayer': 9,\n",
       " '/api/google-cloud-sql': 9,\n",
       " '/api/nephoscale': 9,\n",
       " '/api/mistio': 9,\n",
       " '/api/openstack': 9,\n",
       " '/api/rackspace-cloud-servers': 9,\n",
       " '/api/google-cloud-dns': 9,\n",
       " '/api/windows-sidebar-gadgets': 5,\n",
       " '/api/ookaboo': 3,\n",
       " '/api/aonaware-dictionary': 15,\n",
       " '/api/uclassify': 5,\n",
       " '/api/moonshadow-mobile': 1,\n",
       " '/api/dopplr': 1,\n",
       " '/api/moo': 2,\n",
       " '/api/voxeo': 3,\n",
       " '/api/trailer-addict': 2,\n",
       " '/api/trakttv': 6,\n",
       " '/api/rpm-software': 1,\n",
       " '/api/idiomag': 2,\n",
       " '/api/ontok-wikipedia': 4,\n",
       " '/api/musikki-music': 6,\n",
       " '/api/mynetdiary-food-search': 3,\n",
       " '/api/wordstream-keyword-tool': 1,\n",
       " '/api/connotea': 4,\n",
       " '/api/cartodb': 3,\n",
       " '/api/fcc': 1,\n",
       " '/api/npr-one-station-finder': 1,\n",
       " '/api/db-direct': 1,\n",
       " '/api/metalocator': 5,\n",
       " '/api/oracle-netsuite': 16,\n",
       " '/api/orb': 1,\n",
       " '/api/dance-tunes': 1,\n",
       " '/api/beatport': 1,\n",
       " '/api/trendrr': 1,\n",
       " '/api/newscloud': 1,\n",
       " '/api/omgili': 8,\n",
       " '/api/foxrate': 2,\n",
       " '/api/nolapro': 1,\n",
       " '/api/campfire': 1,\n",
       " '/api/pubsub': 2,\n",
       " '/api/otnettv': 1,\n",
       " '/api/cronofy': 1,\n",
       " '/api/travel-booking-network': 3,\n",
       " '/api/san-francisco-crimespotting': 5,\n",
       " '/api/nyc-open-data': 7,\n",
       " '/api/ckan-italy': 5,\n",
       " '/api/ckan-norway': 5,\n",
       " '/api/brazil-ckan': 5,\n",
       " '/api/ckan-ireland': 5,\n",
       " '/api/ckan': 5,\n",
       " '/api/ckan-czech-republic': 5,\n",
       " '/api/open-dining-network-food-ordering': 2,\n",
       " '/api/zotero': 1,\n",
       " '/api/honjp': 1,\n",
       " '/api/bump': 1,\n",
       " '/api/google-analytics-metadata': 2,\n",
       " '/api/pagerduty': 1,\n",
       " '/api/addthis-analytics': 3,\n",
       " '/api/textamerica': 3,\n",
       " '/api/google-apps-marketplace': 6,\n",
       " '/api/google-provisioning': 6,\n",
       " '/api/pixabay-free-images': 1,\n",
       " '/api/favqs': 1,\n",
       " '/api/windows-live-spaces-photo': 27,\n",
       " '/api/telize': 2,\n",
       " '/api/hotelston': 1,\n",
       " '/api/plazes': 2,\n",
       " '/api/long-url-please': 2,\n",
       " '/api/google-mirror': 2,\n",
       " '/api/automattic-wordpress-widgets': 1,\n",
       " '/api/zappos': 5,\n",
       " '/api/authoritylabs-account': 5,\n",
       " '/api/authoritylabs-partner': 5,\n",
       " '/api/postalmethods': 2,\n",
       " '/api/4shared': 22,\n",
       " '/api/google-cloud-print': 4,\n",
       " '/api/actual-reports': 1,\n",
       " '/api/pdf-generator': 1,\n",
       " '/api/google-my-business': 4,\n",
       " '/api/facebook-business-mapping': 4,\n",
       " '/api/dlvrit': 13,\n",
       " '/api/zoopla': 1,\n",
       " '/api/globexplorer': 2,\n",
       " '/api/lulu-publishing': 2,\n",
       " '/api/internet-archive': 3,\n",
       " '/api/healthfindergov': 2,\n",
       " '/api/eduroam': 2,\n",
       " '/api/quarkrank': 4,\n",
       " '/api/quickbase': 2,\n",
       " '/api/dun-and-bradstreet-business-verification': 2,\n",
       " '/api/plum-fuse': 1,\n",
       " '/api/clicky': 2,\n",
       " '/api/quizlet-flashcards': 2,\n",
       " '/api/swoogle': 5,\n",
       " '/api/extractiv': 5,\n",
       " '/api/saplo-text-analysis': 5,\n",
       " '/api/pachube': 3,\n",
       " '/api/rhymebrain': 2,\n",
       " '/api/realtybaron-answers': 3,\n",
       " '/api/uservoice': 8,\n",
       " '/api/whois': 9,\n",
       " '/api/energystar-abs': 2,\n",
       " '/api/opendoar': 1,\n",
       " '/api/scalr': 8,\n",
       " '/api/socialoomph': 8,\n",
       " '/api/scribd-ipaper': 3,\n",
       " '/api/beenverified': 1,\n",
       " ...}"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f = open('all_pairs.txt',\"r\",encoding='utf-8' )\n",
    "data = f.readlines()[1:]\n",
    "f.close()\n",
    "n = {}\n",
    "for d in data:\n",
    "    d = d.strip('()').split(\",\")\n",
    "    api = d[0].strip(\"\\'\\'\")\n",
    "    num = int(d[3])\n",
    "    if api in n:\n",
    "        n[api]+= num\n",
    "    else:\n",
    "        n[api] = num\n",
    "    \n",
    "#     if n[api] :\n",
    "#         n[api] = num\n",
    "#     else:\n",
    "#         n[api]+=num\n",
    "n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "fe3b7bff",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>target</th>\n",
       "      <th>api_c</th>\n",
       "      <th>num2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>/api/coupon</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>/api/nationbuilder</td>\n",
       "      <td>Social</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>/api/hpe-haven-ondemand-view-document</td>\n",
       "      <td>Documents</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>/api/mapbox</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>/api/mymemory</td>\n",
       "      <td>Tools</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12609</th>\n",
       "      <td>/api/geocoder</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12610</th>\n",
       "      <td>/api/geocoderca</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12611</th>\n",
       "      <td>/api/globexplorer</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12612</th>\n",
       "      <td>/api/flickr</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12613</th>\n",
       "      <td>/api/amazon-product-advertising</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>12614 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                      target      api_c  num2\n",
       "0                                /api/coupon        NaN     1\n",
       "1                         /api/nationbuilder     Social     1\n",
       "2      /api/hpe-haven-ondemand-view-document  Documents     1\n",
       "3                                /api/mapbox    Mapping     1\n",
       "4                              /api/mymemory      Tools     1\n",
       "...                                      ...        ...   ...\n",
       "12609                          /api/geocoder    Mapping     1\n",
       "12610                        /api/geocoderca    Mapping     1\n",
       "12611                      /api/globexplorer    Mapping     1\n",
       "12612                            /api/flickr     Photos     1\n",
       "12613        /api/amazon-product-advertising  eCommerce     1\n",
       "\n",
       "[12614 rows x 3 columns]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt9 = dt1.loc[:,['target','api_c','num2']]\n",
    "dt9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "616b0f73",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>source</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>target</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>/api/google-app-engine-admin</th>\n",
       "      <td>/api/google-app-engine</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-app-engine-task-queue</th>\n",
       "      <td>/api/google-app-engine</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-cloud-app-engine-tasks</th>\n",
       "      <td>/api/google-app-engine</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-app-engine-admin-rpc</th>\n",
       "      <td>/api/google-app-engine</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-static-maps</th>\n",
       "      <td>/api/google-maps</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-street-view-image</th>\n",
       "      <td>/api/google-maps</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-maps-directions</th>\n",
       "      <td>/api/google-maps</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-maps-distance-matrix</th>\n",
       "      <td>/api/google-maps</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api//api/google-maps-elevation</th>\n",
       "      <td>/api/google-maps</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-maps-geocoding</th>\n",
       "      <td>/api/google-maps</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-maps-geolocation</th>\n",
       "      <td>/api/google-maps</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-maps-places</th>\n",
       "      <td>/api/google-maps</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-maps-roads</th>\n",
       "      <td>/api/google-maps</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-maps-time-zone</th>\n",
       "      <td>/api/google-maps</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/twitter-ads</th>\n",
       "      <td>/api/twitter</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/twitter-search-tweets</th>\n",
       "      <td>/api/twitter</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/twitter-direct-message</th>\n",
       "      <td>/api/twitter</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/facebook-ads</th>\n",
       "      <td>/api/facebook</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/facebook-atlas</th>\n",
       "      <td>/api/facebook</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/facebook-graph</th>\n",
       "      <td>/api/facebook</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/facebook-marketing</th>\n",
       "      <td>/api/facebook</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/advicent-narrator-connect-naviplan-fact-finder</th>\n",
       "      <td>/api/advicent-narrator-connect</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/advicent-narrator-connect-naviplan-financial-planning</th>\n",
       "      <td>/api/advicent-narrator-connect</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/world-weather-online-city-search</th>\n",
       "      <td>/api/world-weather-online</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/world-weather-online-time-zone</th>\n",
       "      <td>/api/world-weather-online</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/world-weather-online-ski-and-mountain</th>\n",
       "      <td>/api/world-weather-online</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/world-weather-online-historical-or-past-weather</th>\n",
       "      <td>/api/world-weather-online</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/world-weather-online-local-city-weather</th>\n",
       "      <td>/api/world-weather-online</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/world-weather-online-marine-sailing-surfing-weather</th>\n",
       "      <td>/api/world-weather-online</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/world-weather-online-ski-weather</th>\n",
       "      <td>/api/world-weather-online</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-client</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-model</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-stories</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-projects</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-profile</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-permissions</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-invite</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-build</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-feedback</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-user-management</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-single-sign</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-team-server</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mendix-deploy</th>\n",
       "      <td>/api/mendix</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                            source\n",
       "target                                                                            \n",
       "/api/google-app-engine-admin                                /api/google-app-engine\n",
       "/api/google-app-engine-task-queue                           /api/google-app-engine\n",
       "/api/google-cloud-app-engine-tasks                          /api/google-app-engine\n",
       "/api/google-app-engine-admin-rpc                            /api/google-app-engine\n",
       "/api/google-static-maps                                           /api/google-maps\n",
       "/api/google-street-view-image                                     /api/google-maps\n",
       "/api/google-maps-directions                                       /api/google-maps\n",
       "/api/google-maps-distance-matrix                                  /api/google-maps\n",
       "/api//api/google-maps-elevation                                   /api/google-maps\n",
       "/api/google-maps-geocoding                                        /api/google-maps\n",
       "/api/google-maps-geolocation                                      /api/google-maps\n",
       "/api/google-maps-places                                           /api/google-maps\n",
       "/api/google-maps-roads                                            /api/google-maps\n",
       "/api/google-maps-time-zone                                        /api/google-maps\n",
       "/api/twitter-ads                                                      /api/twitter\n",
       "/api/twitter-search-tweets                                            /api/twitter\n",
       "/api/twitter-direct-message                                           /api/twitter\n",
       "/api/facebook-ads                                                    /api/facebook\n",
       "/api/facebook-atlas                                                  /api/facebook\n",
       "/api/facebook-graph                                                  /api/facebook\n",
       "/api/facebook-marketing                                              /api/facebook\n",
       "/api/advicent-narrator-connect-naviplan-fact-fi...  /api/advicent-narrator-connect\n",
       "/api/advicent-narrator-connect-naviplan-financi...  /api/advicent-narrator-connect\n",
       "/api/world-weather-online-city-search                    /api/world-weather-online\n",
       "/api/world-weather-online-time-zone                      /api/world-weather-online\n",
       "/api/world-weather-online-ski-and-mountain               /api/world-weather-online\n",
       "/api/world-weather-online-historical-or-past-we...       /api/world-weather-online\n",
       "/api/world-weather-online-local-city-weather             /api/world-weather-online\n",
       "/api/world-weather-online-marine-sailing-surfin...       /api/world-weather-online\n",
       "/api/world-weather-online-ski-weather                    /api/world-weather-online\n",
       "/api/mendix-client                                                     /api/mendix\n",
       "/api/mendix-model                                                      /api/mendix\n",
       "/api/mendix-stories                                                    /api/mendix\n",
       "/api/mendix-projects                                                   /api/mendix\n",
       "/api/mendix-profile                                                    /api/mendix\n",
       "/api/mendix-permissions                                                /api/mendix\n",
       "/api/mendix-invite                                                     /api/mendix\n",
       "/api/mendix-build                                                      /api/mendix\n",
       "/api/mendix-feedback                                                   /api/mendix\n",
       "/api/mendix-user-management                                            /api/mendix\n",
       "/api/mendix-single-sign                                                /api/mendix\n",
       "/api/mendix-team-server                                                /api/mendix\n",
       "/api/mendix-deploy                                                     /api/mendix"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt10 = pd.read_csv(\"split_nodes.csv\",index_col = 1,encoding=\"utf8\")\n",
    "dt10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "fd034e6f",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>source</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>target</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>/api/weather-company-data-core</th>\n",
       "      <td>/api/weather-channel</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/ibm-watson-customer-engagement</th>\n",
       "      <td>/api/silverpop</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/coinbase</th>\n",
       "      <td>/api/blockrio</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/monzo</th>\n",
       "      <td>/api/mondo-web-hooks</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/gunbroker</th>\n",
       "      <td>/api/gunbroker-soap</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/monzo</th>\n",
       "      <td>/api/mondo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/tune-app-marketing</th>\n",
       "      <td>/api/mobiledevhq</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/ebay-commerce-network</th>\n",
       "      <td>/api/shoppingcom</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/webxr-device</th>\n",
       "      <td>/api/mozilla-webvr</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/microsoft-azure-cognitive-services-bing-web-search</th>\n",
       "      <td>/api/bing</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/linkedin</th>\n",
       "      <td>/api/linkedin-people-search</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-photos</th>\n",
       "      <td>/api/google-picasa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/usda-fooddata-central</th>\n",
       "      <td>/api/national-nutrient-database</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/digital-turbine</th>\n",
       "      <td>/api/appia</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/cisco-videoscape</th>\n",
       "      <td>/api/nds-service-delivery-platform</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/clx</th>\n",
       "      <td>/api/mblox</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/proovl-sms</th>\n",
       "      <td>/api/2-waysms</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                source\n",
       "target                                                                                \n",
       "/api/weather-company-data-core                                    /api/weather-channel\n",
       "/api/ibm-watson-customer-engagement                                     /api/silverpop\n",
       "/api/coinbase                                                            /api/blockrio\n",
       "/api/monzo                                                        /api/mondo-web-hooks\n",
       "/api/gunbroker                                                     /api/gunbroker-soap\n",
       "/api/monzo                                                                  /api/mondo\n",
       "/api/tune-app-marketing                                               /api/mobiledevhq\n",
       "/api/ebay-commerce-network                                            /api/shoppingcom\n",
       "/api/webxr-device                                                   /api/mozilla-webvr\n",
       "/api/microsoft-azure-cognitive-services-bing-we...                           /api/bing\n",
       "/api/linkedin                                              /api/linkedin-people-search\n",
       "/api/google-photos                                                  /api/google-picasa\n",
       "/api/usda-fooddata-central                             /api/national-nutrient-database\n",
       "/api/digital-turbine                                                        /api/appia\n",
       "/api/cisco-videoscape                               /api/nds-service-delivery-platform\n",
       "/api/clx                                                                    /api/mblox\n",
       "/api/proovl-sms                                                          /api/2-waysms"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt11 = pd.read_csv(\"tranfer_nodes.csv\",index_col = 1,encoding=\"utf8\")\n",
    "dt11"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "17a4b628",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 2305,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 2305,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 2305,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 2305,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 1381,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 1381,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 2305,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 2305,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " 0,\n",
       " ...]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "use=[]\n",
    "for api in dt9['target']:\n",
    "    source = ''\n",
    "    if api in dt10.index.values:\n",
    "        source = dt10.loc[api]['source']\n",
    "    if api in dt11.index.values:\n",
    "        source = dt11.loc[api]['source']\n",
    "    if source in n:\n",
    "        use.append(n[source])\n",
    "    else:\n",
    "        use.append(0)\n",
    "use        \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "896ee05a",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>target</th>\n",
       "      <th>api_c</th>\n",
       "      <th>num2</th>\n",
       "      <th>active_use</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>/api/coupon</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>/api/nationbuilder</td>\n",
       "      <td>Social</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>/api/hpe-haven-ondemand-view-document</td>\n",
       "      <td>Documents</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>/api/mapbox</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>/api/mymemory</td>\n",
       "      <td>Tools</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12609</th>\n",
       "      <td>/api/geocoder</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12610</th>\n",
       "      <td>/api/geocoderca</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12611</th>\n",
       "      <td>/api/globexplorer</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12612</th>\n",
       "      <td>/api/flickr</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12613</th>\n",
       "      <td>/api/amazon-product-advertising</td>\n",
       "      <td>eCommerce</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>12614 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                      target      api_c  num2  active_use\n",
       "0                                /api/coupon        NaN     1           0\n",
       "1                         /api/nationbuilder     Social     1           0\n",
       "2      /api/hpe-haven-ondemand-view-document  Documents     1           0\n",
       "3                                /api/mapbox    Mapping     1           0\n",
       "4                              /api/mymemory      Tools     1           0\n",
       "...                                      ...        ...   ...         ...\n",
       "12609                          /api/geocoder    Mapping     1           0\n",
       "12610                        /api/geocoderca    Mapping     1           0\n",
       "12611                      /api/globexplorer    Mapping     1           0\n",
       "12612                            /api/flickr     Photos     1           0\n",
       "12613        /api/amazon-product-advertising  eCommerce     1           0\n",
       "\n",
       "[12614 rows x 4 columns]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#增加列active_use，使用被协同调用的次数，表示该api的兼容程度。active_use越大\n",
    "#表示该api的兼容性越大\n",
    "dt9['active_use'] = use\n",
    "dt9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "e2434bd6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>target</th>\n",
       "      <th>api_c</th>\n",
       "      <th>num2</th>\n",
       "      <th>active_use</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>8771</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7092</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6222</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2702</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4554</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1533</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>804</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2277</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5882</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2998</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6207</th>\n",
       "      <td>/api/google-street-view-image</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6266</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7626</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2077</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8786</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3817</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1014</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>278</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7682</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1421</th>\n",
       "      <td>/api/google-street-view-image</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6405</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4909</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2927</th>\n",
       "      <td>/api/google-street-view-image</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1418</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5580</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4052</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3922</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>705</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3295</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3022</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6791</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6915</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5325</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>843</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2031</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8400</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7324</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020</th>\n",
       "      <td>/api/google-street-view-image</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7082</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6806</th>\n",
       "      <td>/api/google-street-view-image</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3348</th>\n",
       "      <td>/api/google-street-view-image</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>432</th>\n",
       "      <td>/api/google-maps-geolocation</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1912</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6540</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8110</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1392</th>\n",
       "      <td>/api/google-street-view-image</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3345</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8480</th>\n",
       "      <td>/api/google-static-maps</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2631</th>\n",
       "      <td>/api/google-street-view-image</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1416</th>\n",
       "      <td>/api/google-street-view-image</td>\n",
       "      <td>Photos</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5329</th>\n",
       "      <td>/api/google-maps-places</td>\n",
       "      <td>Mapping</td>\n",
       "      <td>1</td>\n",
       "      <td>2305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4583</th>\n",
       "      <td>/api/facebook-graph</td>\n",
       "      <td>Social</td>\n",
       "      <td>1</td>\n",
       "      <td>1381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2496</th>\n",
       "      <td>/api/facebook-graph</td>\n",
       "      <td>Social</td>\n",
       "      <td>1</td>\n",
       "      <td>1381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1806</th>\n",
       "      <td>/api/facebook-graph</td>\n",
       "      <td>Social</td>\n",
       "      <td>1</td>\n",
       "      <td>1381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4411</th>\n",
       "      <td>/api/facebook-graph</td>\n",
       "      <td>Social</td>\n",
       "      <td>1</td>\n",
       "      <td>1381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4917</th>\n",
       "      <td>/api/facebook-graph</td>\n",
       "      <td>Social</td>\n",
       "      <td>1</td>\n",
       "      <td>1381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3850</th>\n",
       "      <td>/api/facebook-graph</td>\n",
       "      <td>Social</td>\n",
       "      <td>1</td>\n",
       "      <td>1381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3030</th>\n",
       "      <td>/api/facebook-graph</td>\n",
       "      <td>Social</td>\n",
       "      <td>1</td>\n",
       "      <td>1381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>772</th>\n",
       "      <td>/api/facebook-graph</td>\n",
       "      <td>Social</td>\n",
       "      <td>1</td>\n",
       "      <td>1381</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                             target    api_c  num2  active_use\n",
       "8771        /api/google-static-maps  Mapping     1        2305\n",
       "7092        /api/google-static-maps  Mapping     1        2305\n",
       "6222        /api/google-static-maps  Mapping     1        2305\n",
       "2702        /api/google-maps-places  Mapping     1        2305\n",
       "4554        /api/google-maps-places  Mapping     1        2305\n",
       "1533        /api/google-maps-places  Mapping     1        2305\n",
       "804         /api/google-maps-places  Mapping     1        2305\n",
       "2277        /api/google-maps-places  Mapping     1        2305\n",
       "5882        /api/google-static-maps  Mapping     1        2305\n",
       "2998        /api/google-maps-places  Mapping     1        2305\n",
       "6207  /api/google-street-view-image   Photos     1        2305\n",
       "6266        /api/google-static-maps  Mapping     1        2305\n",
       "7626        /api/google-static-maps  Mapping     1        2305\n",
       "2077        /api/google-maps-places  Mapping     1        2305\n",
       "8786        /api/google-static-maps  Mapping     1        2305\n",
       "3817        /api/google-maps-places  Mapping     1        2305\n",
       "1014        /api/google-maps-places  Mapping     1        2305\n",
       "278         /api/google-maps-places  Mapping     1        2305\n",
       "52          /api/google-maps-places  Mapping     1        2305\n",
       "7682        /api/google-static-maps  Mapping     1        2305\n",
       "1421  /api/google-street-view-image   Photos     1        2305\n",
       "6405        /api/google-static-maps  Mapping     1        2305\n",
       "4909        /api/google-static-maps  Mapping     1        2305\n",
       "2927  /api/google-street-view-image   Photos     1        2305\n",
       "1418        /api/google-static-maps  Mapping     1        2305\n",
       "5580        /api/google-static-maps  Mapping     1        2305\n",
       "4052        /api/google-maps-places  Mapping     1        2305\n",
       "3922        /api/google-maps-places  Mapping     1        2305\n",
       "705         /api/google-maps-places  Mapping     1        2305\n",
       "3295        /api/google-maps-places  Mapping     1        2305\n",
       "3022        /api/google-maps-places  Mapping     1        2305\n",
       "6791        /api/google-static-maps  Mapping     1        2305\n",
       "6915        /api/google-static-maps  Mapping     1        2305\n",
       "5325        /api/google-static-maps  Mapping     1        2305\n",
       "843         /api/google-maps-places  Mapping     1        2305\n",
       "2031        /api/google-maps-places  Mapping     1        2305\n",
       "8400        /api/google-static-maps  Mapping     1        2305\n",
       "7324        /api/google-static-maps  Mapping     1        2305\n",
       "2020  /api/google-street-view-image   Photos     1        2305\n",
       "7082        /api/google-static-maps  Mapping     1        2305\n",
       "6806  /api/google-street-view-image   Photos     1        2305\n",
       "3348  /api/google-street-view-image   Photos     1        2305\n",
       "432    /api/google-maps-geolocation  Mapping     1        2305\n",
       "1912        /api/google-maps-places  Mapping     1        2305\n",
       "6540        /api/google-static-maps  Mapping     1        2305\n",
       "8110        /api/google-static-maps  Mapping     1        2305\n",
       "1392  /api/google-street-view-image   Photos     1        2305\n",
       "3345        /api/google-maps-places  Mapping     1        2305\n",
       "8480        /api/google-static-maps  Mapping     1        2305\n",
       "2631  /api/google-street-view-image   Photos     1        2305\n",
       "1416  /api/google-street-view-image   Photos     1        2305\n",
       "5329        /api/google-maps-places  Mapping     1        2305\n",
       "4583            /api/facebook-graph   Social     1        1381\n",
       "2496            /api/facebook-graph   Social     1        1381\n",
       "1806            /api/facebook-graph   Social     1        1381\n",
       "4411            /api/facebook-graph   Social     1        1381\n",
       "4917            /api/facebook-graph   Social     1        1381\n",
       "3850            /api/facebook-graph   Social     1        1381\n",
       "3030            /api/facebook-graph   Social     1        1381\n",
       "772             /api/facebook-graph   Social     1        1381"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt9_sort = dt9.sort_values('active_use',ascending=False)\n",
    "dt9_sort[:60]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "aa1aefeb",
   "metadata": {},
   "outputs": [],
   "source": [
    "#根据第二问(out[36])，以及out[42]\n",
    "#可以发现拥有api数量较多并且api兼容性较高的的类别是是Mapping，Social，Photos"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "2c9e8567",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>num2</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>target</th>\n",
       "      <th>active_use</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>/api/google-maps-geolocation</th>\n",
       "      <th>2305</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-static-maps</th>\n",
       "      <th>2305</th>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-maps-places</th>\n",
       "      <th>2305</th>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/nasa</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/quova</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-geocoding</th>\n",
       "      <th>0</th>\n",
       "      <td>36</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-gears-geolocation</th>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-earth</th>\n",
       "      <th>0</th>\n",
       "      <td>47</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-distance-matrix</th>\n",
       "      <th>0</th>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/zoomin</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>86 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                          num2\n",
       "target                        active_use      \n",
       "/api/google-maps-geolocation  2305           1\n",
       "/api/google-static-maps       2305          21\n",
       "/api/google-maps-places       2305          21\n",
       "/api/nasa                     0              1\n",
       "/api/quova                    0              2\n",
       "...                                        ...\n",
       "/api/google-geocoding         0             36\n",
       "/api/google-gears-geolocation 0              6\n",
       "/api/google-earth             0             47\n",
       "/api/google-distance-matrix   0              4\n",
       "/api/zoomin                   0              2\n",
       "\n",
       "[86 rows x 1 columns]"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#对于类别“Mapping\"\n",
    "dt_mapping = dt9[dt9['api_c'] == 'Mapping']\n",
    "dt_mapping_api = dt_mapping.groupby(['target','active_use'])[['num2']].sum()\n",
    "dt_mapping_api1 = dt_mapping_api.sort_values('active_use',ascending=False)\n",
    "dt_mapping_api1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "370d5d0c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/api/google-maps'"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt_mapping_api.idxmax()['num2']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "6b531826",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/api/google-maps-places'"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt_mapping_api.idxmax()['active_use']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "fd512aa3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>num2</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>target</th>\n",
       "      <th>active_use</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>/api/google-maps-geolocation</th>\n",
       "      <th>2305</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-static-maps</th>\n",
       "      <th>2305</th>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/google-maps-places</th>\n",
       "      <th>2305</th>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/nasa</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/quova</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/pushpin</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/poly9-freeearth</th>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/peekacity</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/ordnance-survey-maps</th>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/openstreetmap</th>\n",
       "      <th>0</th>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/openlayers</th>\n",
       "      <th>0</th>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/ontok</th>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/1map</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mapquest</th>\n",
       "      <th>0</th>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/multimap</th>\n",
       "      <th>0</th>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/microsoft-mappoint</th>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/microsoft-bing-maps</th>\n",
       "      <th>0</th>\n",
       "      <td>117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/metalocator</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/metacarta</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/mapstraction</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                         num2\n",
       "target                       active_use      \n",
       "/api/google-maps-geolocation 2305           1\n",
       "/api/google-static-maps      2305          21\n",
       "/api/google-maps-places      2305          21\n",
       "/api/nasa                    0              1\n",
       "/api/quova                   0              2\n",
       "/api/pushpin                 0              1\n",
       "/api/poly9-freeearth         0              6\n",
       "/api/peekacity               0              1\n",
       "/api/ordnance-survey-maps    0              3\n",
       "/api/openstreetmap           0             19\n",
       "/api/openlayers              0             13\n",
       "/api/ontok                   0              3\n",
       "/api/1map                    0              1\n",
       "/api/mapquest                0              8\n",
       "/api/multimap                0             12\n",
       "/api/microsoft-mappoint      0              3\n",
       "/api/microsoft-bing-maps     0            117\n",
       "/api/metalocator             0              1\n",
       "/api/metacarta               0              1\n",
       "/api/mapstraction            0              2"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt_mapping_api1 = dt_mapping_api.sort_values('active_use',ascending=False)\n",
    "#按照active_use排序，得到前20个\n",
    "dt_mapping_api1.iloc[:20]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "850b7f03",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>num2</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>target</th>\n",
       "      <th>active_use</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>/api/facebook-graph</th>\n",
       "      <th>1381</th>\n",
       "      <td>49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/43-places</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/tagalus</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/socialoomph</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/social-share-count</th>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/sitesummary</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/singly</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/sina-weibo</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/shizzow</th>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/scoopit</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/ritetag</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/repustate</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/readsocial</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/readmill</th>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/qwerly</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/pownce</th>\n",
       "      <th>0</th>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/posterous</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/plazes</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/plancast</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/pinterest-domain</th>\n",
       "      <th>0</th>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                    num2\n",
       "target                  active_use      \n",
       "/api/facebook-graph     1381          49\n",
       "/api/43-places          0              1\n",
       "/api/tagalus            0              2\n",
       "/api/socialoomph        0              1\n",
       "/api/social-share-count 0              6\n",
       "/api/sitesummary        0              1\n",
       "/api/singly             0              1\n",
       "/api/sina-weibo         0              1\n",
       "/api/shizzow            0              3\n",
       "/api/scoopit            0              2\n",
       "/api/ritetag            0              1\n",
       "/api/repustate          0              1\n",
       "/api/readsocial         0              1\n",
       "/api/readmill           0              3\n",
       "/api/qwerly             0              2\n",
       "/api/pownce             0              8\n",
       "/api/posterous          0              2\n",
       "/api/plazes             0              2\n",
       "/api/plancast           0              2\n",
       "/api/pinterest-domain   0             10"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#对于类别Social\n",
    "dt_social = dt9[dt9['api_c'] == 'Social']\n",
    "dt_social_api = dt_social.groupby(['target','active_use'])[['num2']].sum()\n",
    "dt_social_api1 = dt_social_api.sort_values('active_use',ascending=False)\n",
    "#按照active_use排序，得到前20个\n",
    "dt_social_api1[:20]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "28c6ff2c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>num2</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>target</th>\n",
       "      <th>active_use</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>/api/google-street-view-image</th>\n",
       "      <th>2305</th>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/23</th>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/smugmug</th>\n",
       "      <th>0</th>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/photoshelter</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/picnik</th>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/picplz</th>\n",
       "      <th>0</th>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/pikeo</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/pixlr</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/recognizeim</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/ribbet</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/riya</th>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/shutterpoint</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/simpleapi</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/snapr</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/photo</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/snipshot</th>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/steply</th>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/thumbalizr</th>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/touchnote</th>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>/api/tweetphoto</th>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                          num2\n",
       "target                        active_use      \n",
       "/api/google-street-view-image 2305           9\n",
       "/api/23                       0              6\n",
       "/api/smugmug                  0             11\n",
       "/api/photoshelter             0              1\n",
       "/api/picnik                   0              3\n",
       "/api/picplz                   0              5\n",
       "/api/pikeo                    0              1\n",
       "/api/pixlr                    0              2\n",
       "/api/recognizeim              0              2\n",
       "/api/ribbet                   0              1\n",
       "/api/riya                     0              3\n",
       "/api/shutterpoint             0              1\n",
       "/api/simpleapi                0              2\n",
       "/api/snapr                    0              2\n",
       "/api/photo                    0              2\n",
       "/api/snipshot                 0              3\n",
       "/api/steply                   0              2\n",
       "/api/thumbalizr               0              3\n",
       "/api/touchnote                0              1\n",
       "/api/tweetphoto               0              6"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#对于类别Photos\n",
    "dt_Photos = dt9[dt9['api_c'] == 'Photos']\n",
    "dt_Photos_api = dt_Photos.groupby(['target','active_use'])[['num2']].sum()\n",
    "dt_Photos_api1 = dt_Photos_api.sort_values('active_use',ascending=False)\n",
    "#按照active_use排序，得到前20个\n",
    "dt_Photos_api1[:20]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0c6cb36d",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
